Tries to 'smartly' convert factor and character vectors to numeric.
convertToNumeric(vector, byFactorLabel = FALSE)
The vector to convert.
When converting factors, whether to do this
by their label value (TRUE
) or their level value (FALSE
).
The converted vector.
ufs::convertToNumeric(as.character(1:8));
#> [1] 1 2 3 4 5 6 7 8