I am having trouble with the recode function that is provided in the CAR package. I trying to create a new factors based on existing factors.

E.g.

>x <- as.factor(1:20)
>y <- recode(x, " 1:5='A'; 6:10='B'; 11:15='C'; 16:20='D' ")
>y

[1] A A A A A 6 7 8 9 A A A A A A A A A A A
Levels: 6 7 8 9 A

Could someone point to me, my error? Thanks

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to