is.categorical: Determine if a vector is categorical or not

View source: R/compile-typing.R

is.categoricalR Documentation

Determine if a vector is categorical or not

Description

Determine if a vector is categorical or not

Usage

is.categorical(x, threshold = NA)

Arguments

x

Vector to determine type of

threshold

The upper threshold of unique values for which a vector is considered categorical.

Value

A Boolean: TRUE / FALSE

Examples


is.categorical(c(1,2,3))
is.categorical(c(rep(1,20), rep(2, 20), rep(3, 20)), threshold=5)
is.categorical(c("A","B","B"))
is.categorical(factor(c("A","B","C")))
is.categorical(factor(c("A","B","B","A")))
is.categorical(factor(c(TRUE, FALSE, TRUE, FALSE)))


tangram documentation built on Feb. 16, 2023, 5:59 p.m.