[R] function to replace values doesn't work on vectors

WoutH w.denhollander at lumc.nl
Fri Jan 13 15:11:13 CET 2012


 I've got a numeric vector with values ranging from 1 to 5, I would like to
catagorize these values like this:

1 becomes catagory 1
3 becomes catagory 3
And everything else in catagory 2. The simple function I wrote beneath works
for single numeric data, but for some reason I am unable to feed it vectors.
Any help would be appreciated, as I'm fairly new to R.



--
View this message in context: http://r.789695.n4.nabble.com/function-to-replace-values-doesn-t-work-on-vectors-tp4292235p4292235.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list