[R] Conditional Loop For Data Frame Columns

jawbonemurphy jdurlandster at gmail.com
Mon Jan 9 06:02:39 CET 2012


Hi Dave,

Thanks for your response!

I'm new at R, and I'm afraid I'm not sure what you mean by:

?lapply
?"["
?order

Were these suggestions for other commands to try?  If so, can you be more
specific?  I apologize for being clueless :)

Secondly, you're right that the script I have now leaves me with the means
from the last column.  Do you have any suggestions for how to write the
results for each "i" to a unique vector?  I was going to try:

mean_i <- tapply(x[,i], ID, etc..., but I was thinking that this would just
create a vector named "mean_i" w/ results of last column, not a separate
vector for each "i".  I guess what I want is some command to print the
result of each run before repeating with the next "i".  Any ideas?  Again,
thanks for the help.

Best,
Logan



--
View this message in context: http://r.789695.n4.nabble.com/Conditional-Loop-For-Data-Frame-Columns-tp4276821p4277615.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list