factorValues: Retrieve the values within a factor object

Description Usage Arguments Value

Description

This function retrieves the *values* within a factor object. There is a subtle but serious gotcha when using factors that is outlined in the help for factor() under the Warning section. Notably, then type-casting factors, what is returned is the *indices* of the factor, not the values stored in the factor. This is fairly easy to catch when factors are type character, but can cause serious bugs when they are numeric. The purpose of this function is to provide an easy way to return the values stored within a factor

Usage

1

Arguments

x

the factor from which to extract values

Value

the values stored in the factor; this will be numeric if possible, character otherwise


henkelstone/NPEL.Classification documentation built on May 17, 2019, 3:42 p.m.