R/r-utility-flevels.R

Defines functions flevels

Documented in flevels

## get factor levels as a factor of the same levels
flevels <- function(v) { factor(levels(v), levels=levels(v)) }


if (FALSE)
{

  # usage examples
flevels(weather$outlook)
flevels(weather$outlook)[as.integer(weather$outlook)]==weather$outlook

}
42n4/dmr.util documentation built on May 20, 2019, 2:02 p.m.