WoutH wrote
>
> 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 r
I don't see any signs of a simple function, but I'd use ifelse().
y <- ifelse(x == 1, 1, ifelse(x == 3, 3, 2))
or some such. (Lack of reproducible example means lack of actual
testing.)
Sarah
On Fri, Jan 13, 2012 at 9:11 AM, WoutH wrote:
> I've got a numeric vector with values ranging from 1
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
3 matches
Mail list logo