Re: [R] screen if a value is within range

2012-12-01 Thread David Winsemius
On Dec 1, 2012, at 9:55 AM, R. Michael Weylandt wrote: 15 < a & a < 20 Wrap it in a function if you like: in_interval <- function(x, interval){ stopifnot(length(interval) == 2L) interval[1] < x & x < interval[2] } in_interval(a, c(15, 20)) Could just use the findInterval function: fi

Re: [R] screen if a value is within range

2012-12-01 Thread Robert Baer
On 12/1/2012 10:50 AM, Andras Farkas wrote: Dear all, could you please give me some pointers on how I could make R screen for a value if it falls within a certain range? I looked at the subset function, but is not doing it, perhaps because I only have 1 value to screen? aptreciate the inp

Re: [R] screen if a value is within range

2012-12-01 Thread R. Michael Weylandt
15 < a & a < 20 Wrap it in a function if you like: in_interval <- function(x, interval){ stopifnot(length(interval) == 2L) interval[1] < x & x < interval[2] } in_interval(a, c(15, 20)) Cheers, Michael On Sat, Dec 1, 2012 at 4:50 PM, Andras Farkas wrote: > > could you please give me some

[R] screen if a value is within range

2012-12-01 Thread Andras Farkas
Dear all,   could you please give me some pointers on how I could make R screen for a value if it falls within a certain range? I looked at the subset function, but is not doing it, perhaps because I only have 1 value to screen?   aptreciate the input   ex: a <-16.5 I would like to screen to see