factor2numeric {Smisc}R Documentation

A simple function for converting factors to numeric values

Description

A simple function for converting factors to numeric values

Usage

factor2numeric(x)

Arguments

x

A vector of type factor

Value

x converted to a numeric vector

Examples

# Define a factor object
y <- factor(5:7)
y

# incorrectly convert to numeric
as.numeric(y)

# correctly convert
factor2numeric(y)


[Package Smisc version 0.3.9.1 Index]