I am trying to recode a factor variable in R and using the following code:
library(car)
napier_captureComplexity=recode(napier$a_SpatialConnectivity,"'1 - Very simple and clear: no diagrams, single sheets'=1;'2 - Reasonably simple: some simple diagrams or second sheets'=2;'3 - Reasonably complex: multiple diagrams or sheets but can be followed'=3;'4 - Moderately complex: multiple diagrams and sheets'=4;'5 - Very complex'=5;",as.factor.result=FALSE)
And get the following error message:
Error in parse(text = range[[1]][1]) : <text>:1:1: unexpected INCOMPLETE_STRING 1: '4 - Moderately complex
With a ^ below the number 4
I'm not sure what is causing this, I had wondered about the : through the code but I am not using c() and the code executes fine on other factors in the dataset that have similar string values in them.
Any help is appreciated!