Re: [R] Which hist cell each value falls in?

2009-12-21 Thread S Ellison
cut() might work if you want a character version... set.seed(221) x-rnorm(50) y-rnorm(1) xh-hist(x) cut(y, breaks=xh$breaks) #or as.character(cut(y, breaks=xh$breaks)) #or for a 'level number' version (a bit like which()) as.numeric(cut(y, breaks=xh$breaks)) Jim Lemon j...@bitwrit.com.au

Re: [R] Which hist cell each value falls in?

2009-12-18 Thread David Winsemius
On Dec 18, 2009, at 2:57 AM, Jim Lemon wrote: On 12/18/2009 06:35 AM, Doug Hill wrote: Hi, all. I'm using hist() to obtain a vector of break values in an interval. I then want to be able to identify which cell any value from another vector falls in. E.g. applying breaks [1] -3.5

Re: [R] Which hist cell each value falls in?

2009-12-18 Thread Doug Hill
Thanks, guys! Doug David Winsemius wrote: On Dec 18, 2009, at 2:57 AM, Jim Lemon wrote: On 12/18/2009 06:35 AM, Doug Hill wrote: Hi, all. I'm using hist() to obtain a vector of break values in an interval. I then want to be able to identify which cell any value from another

[R] Which hist cell each value falls in?

2009-12-17 Thread Doug Hill
Hi, all. I'm using hist() to obtain a vector of break values in an interval. I then want to be able to identify which cell any value from another vector falls in. E.g. applying breaks [1] -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 to x [1] -3.74519666 -0.38183630

Re: [R] Which hist cell each value falls in?

2009-12-17 Thread Jim Lemon
On 12/18/2009 06:35 AM, Doug Hill wrote: Hi, all. I'm using hist() to obtain a vector of break values in an interval. I then want to be able to identify which cell any value from another vector falls in. E.g. applying breaks [1] -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0