%btw% | R Documentation |
The binary operator %btw% returns a logical vector indicating all values in a vector that fall within a specified lower and upper limit.
x %btw% y
x |
A numeric vector. |
y |
Either a numeric vector specifying a lower and upper
limit, or a character string in the form |
A logical vector.
x <- 1:10
# Limits specified as numeric vector
x[ x %btw% c( 3, 6 ) ]
# Limits specified as character string
x[ x %btw% '(3,6)' ]
x[ x %btw% '[3,6]' ]
x[ x %btw% '(3,6]' ]
x[ x %btw% '[3,6)' ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.