Learn R Programming

rock (version 0.8.1)

convertToNumeric: Conveniently convert vectors to numeric

Description

Tries to 'smartly' convert factor and character vectors to numeric.

Usage

convertToNumeric(vector, byFactorLabel = FALSE)

Value

The converted vector.

Arguments

vector

The vector to convert.

byFactorLabel

When converting factors, whether to do this by their label value (TRUE) or their level value (FALSE).

Examples

Run this code
rock::convertToNumeric(as.character(1:8));

Run the code above in your browser using DataLab