I have a dataframe
division | category
A | tools
A | work
B | tools
B | TOOLS
both columns are factor variables. how do I convert TOOLS to tools?
I tried
df$category <- as.character(df$category)
df$category <- lapply(df$category, function(x) { tolower(x) } )
df$category <- as.factor(df$category)
but then for the last command I get:
Error in sort.list(y) : 'x' must be atomic for 'sort.list'
Have you called 'sort' on a list?
What does that mean?