detect_fct: Detect whether a factor is truly factor or character

Description Usage Arguments Value Examples

View source: R/detect_fct.R

Description

If the number of unique values equal to the length of input, we consider the input as factor; otherwise, we consider it as character

Usage

1

Arguments

x

factor

Value

boolean; TRUE if input should be considered as factor, FALSE if input should be considered as character

Examples

1
2
3
4
5
6
a <- factor(c("high", "high", "low"))
b <- factor(c("high", "low", "medium"))

detect_fct(a)

detect_fct(b)

qiaoyuet/foofactors documentation built on May 29, 2019, 12:06 p.m.