Hi All,
I have a data frame with variable names like A_le, A_me, B_le, B_me, C_le,
C_me....
if A_le=1 or A_me=1 then I need to create a new column A_new=1. Same operation
to create columns B_new, C_new...
Does anyone know how to use loop (or other methods) to create new columns? In
SAS, I can use array to get it done. But I don't know how to do it in R.
Thanks,
Keming Yuan
CDC
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
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.