Re: [R] categorisation of continuous variables in R

2009-11-23 Thread David Winsemius
On Nov 23, 2009, at 8:14 AM, joris meys wrote: Dear all, I'm looking for a function comparable to switch, to categorize a continuous variable in a few levels. ?cut Off course that can be done with a series of ifelse statements, but that looks rather clumsy. I looked at switch, but couldn'

Re: [R] categorisation of continuous variables in R

2009-11-23 Thread joris meys
Never mind, found the function : cut(test,breaks=c(0,10,50,90,100),labels=c("lowest","low","high","highest"),include.lowest=T,right=F) Cheers Joris On Mon, Nov 23, 2009 at 2:14 PM, joris meys wrote: > Dear all, > > I'm looking for a function comparable to switch, to categorize a > continuous va

[R] categorisation of continuous variables in R

2009-11-23 Thread joris meys
Dear all, I'm looking for a function comparable to switch, to categorize a continuous variable in a few levels. Off course that can be done with a series of ifelse statements, but that looks rather clumsy. I looked at switch, but couldn't figure out how to use it for this. I guess that's not possi