Answers for "r convert integer column to factor"

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 "r convert integer column to factor"

Browse Popular Code Answers by Language