fac2num: Convert factor to numeric vector

Description Usage Arguments Details Value Author(s) Examples

View source: R/fac2num.R

Description

Converts the factor labels to numeric values and returns the factor as a numeric vector

Usage

1

Arguments

x

A factor

Details

Returns a vector of numeric values. Elements in the input factor that cannot be converted to numeric will produce NA.

Value

Returns a numeric vector of the same length as x

Author(s)

Claus Ekstrom claus@rprimer.dk

Examples

1
2
f <- factor(c(1,2,1,3,2,1,2,3,1))
fac2num(f)

MESS documentation built on May 29, 2017, 2:39 p.m.

Search within the MESS package
Search all R packages, documentation and source code