Hi All,
I have two variables X, Y. The question is "if the value of X is equal to
one, then the values in Y have to be reversed other wise it should not perfom
any action. I think this should be done using lapply function?
Example
Y values : 1 2 3 NA
X Y (ORIGINAL) Y (REVERSED)
1 NA 1
0 ---- ---
1 2 3
1 1 4
1 3 2
...............
Can anyone provide solution to this?
Thanks,
Pratap
---------------------------------
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.