as.numeric.factor: Convert factor with numeric labels to numeric

Description Usage Arguments Value Author(s) Examples

View source: R/RFunctions.R

Description

Convert factor with numeric labels to numeric

Usage

1
2
## S3 method for class 'factor'
as.numeric(x)

Arguments

x

A factor vector.

Value

A numeric vector.

Author(s)

Caspar J. van Lissa

Examples

1
2
3
4
factor_vector <- factor(c("2", "4", "6", "3", "1"))
numeric_vector <- as.numeric.factor(factor_vector)
factor_vector
numeric_vector

cjvanlissa/motley documentation built on Sept. 23, 2019, 7:39 p.m.