Re: [R] element wise conditional assignment in r

2010-10-02 Thread yunjiangster
, John -- View this message in context: http://r.789695.n4.nabble.com/element-wise-conditional-assignment-in-r-tp2951963p2952010.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] element wise conditional assignment in r

2010-10-01 Thread yunjiangster
this message in context: http://r.789695.n4.nabble.com/element-wise-conditional-assignment-in-r-tp2951963p2951963.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] element wise conditional assignment in r

2010-10-01 Thread Phil Spector
say I have a vector r of 0 and 1's, and another vector v of equal length. I want to assign v[i]-1 to v[i] if r[i]=1, for all i. How would I do that using mapply or any other batch processing keywords? thanks. John -- View this message in context: http://r.789695.n4.nabble.com/element-wise

Re: [R] element wise conditional assignment in r

2010-10-01 Thread Henrique Dallazuanna
. How would I do that using mapply or any other batch processing keywords? thanks. John -- View this message in context: http://r.789695.n4.nabble.com/element-wise-conditional-assignment-in-r-tp2951963p2951963.html Sent from the R help mailing list archive at Nabble.com