Add a spaces! hist(sp$p[sp$r > 0.01]) hist(sp$p[sp$r < -0.01])
compare with hist(sp$p[sp$r <- 0.01]) which is what you tried. Cheers. Henrik Bengtsson Lund University > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Brian J. Haag > Sent: den 13 oktober 2003 21:03 > To: [EMAIL PROTECTED] > Subject: [R] conditional less than > > > I'm sure this is a total noob question, but half an > hour of searching bore no fruit: How do you select a > subset of a vector by negative value? If I try > > > hist(sp$p[sp$r>0.01]) # all is well > > hist(sp$p[sp$r<-0.01]) # this obviously causes > issues > > Also, putting -0.01 in parentheses didn't help. > > Thanks in advance -- > > b > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailma> n/listinfo/r-help > > ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
