[R] if negative value, make zero
peter.langfelder at gmail.com
Fri May 28 18:30:50 CEST 2010
temp2 = tempr
temp2[temp2<0] = 0
On Fri, May 28, 2010 at 8:37 AM, <ecvetano at uwaterloo.ca> wrote:
> I have a data frame with both positive and negative values, and I want to
> make all the negative values equal zero, so i can eventually take an
> I've tried
> temp2 <- ifelse(tempr<0, 0, tempr)
> but it doesn't seem to work.
> Any suggestions?
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help