Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

how to convert all columns of a dataframe into factors in r

DF[sapply(DF, is.character)] <- lapply(DF[sapply(DF, is.character)], 
                                       as.factor)
 
PREVIOUS NEXT
Tagged: #convert #columns #dataframe #factors
ADD COMMENT
Topic
Name
4+1 =