Hi!
I want to transform a string in a number, this is my code:
test <- starwars
home <- test$homeworld
home <- as.numeric(home )
but I have this error:
Error: 'list' object cannot be coerced to type 'double'
My goal is to assign a number to every homeworld. Obviously the lines with the same homeword will have the same number assigned.
How can i fix my code?