I am trying to recode a Character vector to have numerical value that can be used in an equation later on. I keep getting the error:
Error in recode(HealthStatus, Green = 90) : unused argument (Green = 90.......)
I currently have:
HealthStatus <- as.matrix(Real_Example_Data[,3])
New_HealthStatus <- recode(HealthStatus, 'Green'= 90, 'UpGreen'= 80, 'Yellow'= 70, 'UpYellow'= 60, 'Orange'= 50, 'UpOrange'= 40, 'Red'= 20)
I have tried multiple ways of using " " or ' ' to see if that changes the error and it doesn't.
Any help with this would be appreciated. The main thing is that I have to be able to use the numeric values later on.