Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

less than negative in R [closed]

Tags:

r

How can I compare a column in data frame for range? The range is like less than a negative number and greater than a positive number. For Positive number there is no problem but for negative number it is taking it as an assignment operator.Code for reference is given below

Resited<-Reap[mean < -5 & mean > 5,]
like image 801
Kaushal Avatar asked Dec 16 '14 20:12

Kaushal


1 Answers

"mean" cannot be less than -5 and more than 5 at the same time. Did you mean logical OR? If both abs values are the same, you could simply write

Resited <- Reap[abs(mean) > 5, ]
like image 109
Alexey Ferapontov Avatar answered Oct 20 '22 00:10

Alexey Ferapontov