Displaying 1 result from an estimated 1 matches for "isince".
Did you mean:
since
2008 Jun 18
2
ifelse and "&&" vs "&"
Hi,
I noticed whether some one could explain why "&" and "&&" behave differently in data frame transformations.
Consider the following :
a<-data.frame(r=c(0,0,2,3),g=c(0,2,0,2.1))
Then:
> transform(a,R=ifelse(r>0 && g> 0,log(r/g),NA))
r g R
1 0 0.0 NA
2 0 2.0 NA
3 2 0.0 NA
4 3 2.1 NA
but
> transform(a,R=ifelse(r>0 & g>