powered by
Did you forget to pass stringsAsFactors=FALSE? This converts factor variables to characters in a dataframe.
stringsAsFactors=FALSE
unfactor(df)
The dataframe you wish to change the factors into characters.
A data.frame with factors converted to characters.
# NOT RUN { df <- data.frame(a = letters[1:5], x = 1:5, y = LETTERS[1:5], stringsAsFactors = TRUE) str(df) df <- unfactor(df) str(df) # } # NOT RUN { # }
Run the code above in your browser using DataLab