unfactor: Purge factors

Description Usage Arguments Details Value Note Author(s)

Description

Removes all factors from a variable in a sensible way

Usage

1

Arguments

var

The variable from which you want the factors removed

Details

As factors are their own type, to remove factors we must convert each level into another type. This is currently done using "typeless" behaviour: a factor is converted to a numeric vector if this can be done without inducing NAs, otherwise it is coerced using as.character. Currently supported types are: /codefactor, /codedata.frame and /codelist.

Value

The variable with all factors converted to characters or numbers

Note

This function is written by Matthew D. Young and is used in the goseq package.

Author(s)

Matthew D. Young myoung@wehi.edu.au, Gu Mi mig@stat.oregonstate.edu, Yanming Di diy@stat.oregonstate.edu


gu-mi/GOglm documentation built on May 14, 2019, 7:42 a.m.