between: Do the values from x fall between the left and right bounds?

View source: R/between.R

betweenR Documentation

Do the values from x fall between the left and right bounds?

Description

between() utilizes data.table::between() in the background

Usage

between(x, left, right)

Arguments

x

A numeric vector

left, right

Boundary values

Examples

df <- data.table(
  x = 1:5,
  y = 1:5
)

# Typically used in a filter()
df %>%
  filter(between(x, 2, 4))

df %>%
  filter(x %>% between(2, 4))

# Can also use the %between% operator
df %>%
  filter(x %between% c(2, 4))

tidytable documentation built on Sept. 11, 2024, 8:05 p.m.