[R] Accomplishing a loop on multiple columns

Nerak nerak.t at hotmail.com
Thu Jan 12 16:08:36 CET 2012


I just saw a little mistake in my last post: Totally in the end, last line of
the last loop, results$depth[,u] [t-1] should be results$newdepth[,u] [t-1].
My apologies.

for (u in 1:91)
{
results$newdepth [,u]<- results$depth [,u]
for (t in 2:60)
{
results$newdepth[,u][t] <- results$newdepth[,u] [t-1]
}}


--
View this message in context: http://r.789695.n4.nabble.com/Accomplishing-a-loop-on-multiple-columns-tp4284974p4289248.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list