tidyselectors: 'tidyselect' helpers

tidyselectorsR Documentation

tidyselect helpers

Description

#' [Experimental] Predicate functions simplifying picks specification.

Usage

is_categorical(min.len, max.len)

Arguments

min.len

(integer(1)) minimal number of unique values

max.len

(integer(1)) maximal number of unique values

Value

A tidyselector that can be used directly in choices or selected of variables() in picks().

Examples

# select factor column but exclude foreign keys
variables(choices = is_categorical(min.len = 2, max.len = 10))

# Supports tidyselect helpers, e.g. to select all categorical variables with 2 to 10 unique values
dplyr::select(iris, dplyr::where(is_categorical(2, 10)))

p <- picks(
  datasets(is.data.frame, 2L),
  variables(is_categorical(2, 10))
)
resolver(data = list(mtcars = mtcars, iris = iris), x = p)

teal.picks documentation built on Oct. 9, 2026, 5:07 p.m.