View source: R/force.numeric.R
force.numeric | R Documentation |
Force numerical variable to be numeric in a dataframe
force.numeric(data)
data |
a dataframe. |
The dataframe with numerical variables where it is possible.
tablo <- data.frame("A"=as.character(rnorm(20)),"B"=c(rnorm(5),"C3",rnorm(4)),"C"=rep("A",10))
apply(tablo,2,is.numeric)
force.numeric(tablo)-> tablo2 ; apply(tablo2,2,is.numeric)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.