defactorize: Defactorize

Description Usage Arguments Details Value Warning Examples

View source: R/defactorize.R

Description

The function attempts to change vector class from factor to integer, double or character.

Usage

1

Arguments

x

A factor.

Details

The function tries to handle factors of unknown content by attempting to apply different classes and looking for warnings.

Value

A vector of equivalent length of class numeric, integer or character.

Warning

The function disregards levels information available in vectors of the factor class.

Examples

1
2
defactorize(as.factor(c("a", "b")))
defactorize(as.factor(c("a", "b", runif(n = 10))))

konradedgar/KEmisc documentation built on April 15, 2021, 1:50 p.m.