Answers for "convert dataframe to factor r"

R
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 "convert dataframe to factor r"

Browse Popular Code Answers by Language