Learn R Programming

baker (version 1.0.4)

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

Description

Convert factor to numeric without losing information on the label

Usage

unfactor(f)

Value

A numeric vector

Arguments

f

A factor

Examples

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

Run the code above in your browser using DataLab