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
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
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
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
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
5 matches
Mail list logo