[R] multiple selection syntax

Corey Moffet cmoffet at nwrc.ars.usda.gov
Mon Sep 8 19:55:32 CEST 2003

I think you just want &, not &&.

 x <- 1:10
 xint <- x[x>=4 & x < 7]

At 05:57 PM 9/8/2003 +0200, anne wrote:
>This is a very newbie question on R syntax, but I do not find the answer....
>I want to make a selection on an interval say choose Xint in the 
>interval of temperatures 390-399
>I tried this syntax
>Xint<- X[t>=390 && t< 400] 
>typing >XintI get the answer numeric(0)
>it did not select any object! 'though I verified that there indeed are 
>occrencies of X in this interval
>Any idea?
>R-help at stat.math.ethz.ch mailing list
With best wishes and kind regards I am


Corey A. Moffet, Ph.D.
Support Scientist

University of Idaho
Northwest Watershed Research Center
800 Park Blvd, Plaza IV, Suite 105
Boise, ID 83712-7716

Voice: (208) 422-0718
FAX:   (208) 334-1502

More information about the R-help mailing list