factor_asis: Sets levels to the order in which they appear in the data

Description Usage Arguments Value Examples

View source: R/factor_asis.R

Description

Sometimes we want to set levels of a factor to the order which they appear in the data, this function is able to set levels without duplicates.

Usage

1

Arguments

x

factor

Value

factor; return unique levels of input in the order which they appear

Examples

1
2
a <- factor(c("high","low","low","high","medium"))
factor_asis(a)

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