View source: R/massConvertToNumeric.R
massConvertToNumeric | R Documentation |
This function makes it easy to convert many dataframe columns to numeric.
massConvertToNumeric(
dat,
byFactorLabel = FALSE,
ignoreCharacter = TRUE,
stringsAsFactors = FALSE
)
dat |
The dataframe with the columns. |
byFactorLabel |
When converting factors, whether to do this
by their label value ( |
ignoreCharacter |
Whether to convert ( |
stringsAsFactors |
In the returned dataframe, whether to return string (character) vectors as factors or not. |
A data.frame.
### Create a dataset
a <- data.frame(var1 = factor(1:4),
var2 = as.character(5:6),
stringsAsFactors=FALSE);
### Ignores var2
b <- ufs::massConvertToNumeric(a);
### Converts var2
c <- ufs::massConvertToNumeric(a,
ignoreCharacter = FALSE);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.