[R] replace a for loop with lapply or relative
3.14david at gmail.com
Thu Feb 4 22:40:33 CET 2010
I often need to make dichotomous variables out of continuous ones (yes, I
realize the problems with throwing away much of the information), but I then
like to check the min and max of each category. I have the following simple
code to do this that cuts each variable (x1,x2,x3) at the 90th percentile,
and then prints the min and max of each category:
for (i in
Is there a way to replace the ugly for loop in the last line with some type
of apply function that would know that my continuous and indicator variable
are 3 variables apart in the dataframe?
Thanks very much
View this message in context: http://n4.nabble.com/replace-a-for-loop-with-lapply-or-relative-tp1469453p1469453.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help