William Dunlap <wdunlap <at> tibco.com> writes:

> Avoid assignments in arguments to function calls, especially
> multiple assignments to the same object, except when you know
> what you are doing and want to write obscure code.
> 
> Change the above line to
>   data3$input1 <- ifelse(data3$res1==1, data3$input1+10, data3input1)
> 

  data3 <- transform(data3,input1=ifelse(res==1,input1+10,input1))

 might be even clearer

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to