Learn R Programming

nima (version 0.5.0)

factornum: Convert a Factor to Numeric

Description

Convert a factor with numeric levels to a non-factor (numeric).

Usage

factornum(x)

Arguments

x

A vector containing a factor with numeric levels.

Value

The input factor made into a numeric vector.

Examples

Run this code
# NOT RUN {
x <- factor(c(3, 4, 9, 4, 9), levels = c(3,4,9))
factornum(x)
# }

Run the code above in your browser using DataLab