unfactor: Unfactor a vector

Description Usage Arguments Value Examples

Description

Take a factor vector and return a value a vector of either type character or numeric by replacing the factors with their associated labels. If all label names are numeric, a numeric vector will be returned, otherwise a character vector will be returned.

Usage

1
unfactor(factors, ignore = ",", ...)

Arguments

factors

The vector of factors to be unfactored

ignore

(character) Strings formatted to be used by gsub in the pattern argument to be removed from the character vector

...

Additional arguments passed to gsub

Value

character or numeric

Examples

1
2
unfactor(factor(c(3,2,1)))
unfactor(factor(c("1,000","2,123,123")))

drknexus/repsych documentation built on May 15, 2019, 2:19 p.m.