Skip to contents

Values outside interval

Not in closed interval: %][%

Not in open interval: %)(%

Not in half-closed interval (left): %](%

Not in half-closed interval (right): %)[%

Return x not in closed interval: %].[%

Return x not in open interval: %).(%

Return x not in half-closed interval (left): %].(%

Return x not in half-closed interval (right): %).[%

Usage

x %][% j

x %)(% j

x %](% j

x %)[% j

x %].[% j

x %).(% j

x %].(% j

x %).[% j

Arguments

x

A vector

j

A range

Value

logical vector of length x, or, values of x outside the range j

Note

Package DescTools provides similar functions

Examples


# Closed interval
5%][%c(1,5)
#> [1] TRUE
5%].[%c(1,5)
#> [1] 5

# Open interval
5%)(%c(1,5)
#> [1] FALSE
5%).(%c(1,5)
#> numeric(0)

# Half-losed interval left
5%](%c(1,5)
#> [1] FALSE
5%].(%c(1,5)
#> numeric(0)

# Half-losed interval right
5%)[%c(1,5)
#> [1] TRUE
5%).[%c(1,5)
#> [1] 5