convertToNumeric: Conveniently convert vectors to numeric

View source: R/convertToNumeric.R

convertToNumericR Documentation

Conveniently convert vectors to numeric

Description

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

Usage

convertToNumeric(vector, byFactorLabel = FALSE)

Arguments

vector

The vector to convert.

byFactorLabel

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

Value

The converted vector.

Examples

rock::convertToNumeric(as.character(1:8));

gitlab-r-packages-mirror/rock documentation built on Dec. 3, 2024, 5:40 p.m.