Learn R Programming

broman (version 0.84)

fac2num: Convert a factor to numeric

Description

Convert a factor with numeric levels to a non-factor

Usage

fac2num(x)

Value

The input factor made a numeric vector

Arguments

x

A vector containing a factor with numeric levels

Examples

Run this code
x <- factor(c(3, 4, 9, 4, 9), levels=c(3,4,9))
fac2num(x)

Run the code above in your browser using DataLab