unfactor: Convert factor to numeric without losing information on the...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Convert factor to numeric without losing information on the label

Usage

1

Arguments

f

A factor

Value

A numeric vector

Examples

1
2
3
unfactor(factor(c("1","3","3"),levels=c("1","3")))
# contrast this to:
as.numeric(factor(c("1","3","3"),levels=c("1","3"))) 

baker documentation built on Feb. 2, 2022, 9:06 a.m.