Re: [R] using which to identify a range of values

From: Julian Burgos <jmburgos_at_u.washington.edu>
Date: Fri, 18 Jul 2008 13:22:59 -0700

Do simply

which(a<100 & a>=200)

Julian

sj wrote:
> Hello, I am trying to identify values that fall within a certain range. I
> thought that I might be able to use the which function to do this but I have
> been unable to figure out a way to do it. Perhaps a little code will
> illustrate what i am trying to do.
>
>
> a <- rnorm(1000, 100, 50)
> which( 100 < a <= 200)
>
>
> of course this doesn't work but illustrates what I ma trying to do, If
> anyone has suggestions I would greatly appreciate it
>
> Best,
>
> Spencer
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 18 Jul 2008 - 20:26:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 Jul 2008 - 20:33:57 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive