Answers for "r dataframe convert factor to numeric"

0

r dataframe convert factor to numeric

breast$class <- as.numeric(as.character(breast$class))
Posted by: Guest on June-01-2020
0

r dataframe convert factor to numeric

breast[,'class'] <- as.numeric(as.character(breast[,'class']))
Posted by: Guest on June-01-2020
0

r dataframe convert factor to numeric

indx <- sapply(breast, is.factor)
breast[indx] <- lapply(breast[indx], function(x) as.numeric(as.character(x)))
Posted by: Guest on June-01-2020

Code answers related to "r dataframe convert factor to numeric"

Browse Popular Code Answers by Language