[R] conditional data replace (recode, change or whatsoever)

zcatav zcatav at gmail.com
Wed Aug 3 15:57:49 CEST 2011


David Winsemius wrote:
> 
> On Aug 3, 2011, at 8:09 AM, zcatav wrote:
> ........................
> You need to apply the same logical test/selection on the rows of the  
> RHS as you are doing on the LHS.
> Possibly:
> 
> X[ X[,"c"]==1, "b"] <- X[ X[,"c"]==1, "d"]
> 
> 

This solution was suggested by R. Michael Weylandt and it works great.


--
View this message in context: http://r.789695.n4.nabble.com/conditional-data-replace-recode-change-or-whatsoever-tp3714715p3715544.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list