Skip to contents

Extract from a vector values that are in a certain range

Usage

in_range(x, r, rule = "se")

Arguments

x

vector of values that will be checked

r

range in which to check values of x

rule

how boundaries should be treated for inclusion ("s" strict " e" or equal)

Value

a vector with only the values that are in the range given by r

Examples

in_range(1:10, 2:4)
#> [1] 3 4