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

View source: R/utils.R

unfactorR Documentation

Convert factor to numeric without losing information on the label

Description

Convert factor to numeric without losing information on the label

Usage

unfactor(f)

Arguments

f

A factor

Value

A numeric vector

Examples

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

zhenkewu/baker documentation built on May 6, 2024, 11:19 p.m.