factor2numeric: A simple function for converting factors to numeric values

Description Usage Arguments Value Examples

View source: R/factor2numeric.R

Description

A simple function for converting factors to numeric values

Usage

1

Arguments

x

A vector of type factor

Value

x converted to a numeric vector

Examples

1
2
3
4
5
6
7
8
9
# Define a factor object
y <- factor(5:7)
y

# incorrectly convert to numeric
as.numeric(y)

# correctly convert
factor2numeric(y)

Smisc documentation built on May 2, 2019, 2:46 a.m.