Dear R-users, I have a program to realize (big) simulations... I'm building a matrix, where the number of rows is a parameter (say N) and the number of columns is fixed. All the matrix can be completed avoiding loops... excepted one, I think: for the 12th column, on the i-th row, I need something like matrix[1,12]_0 for (i in 1:N) matrix[i,12]_ifelse(matrix[i,1]>0, matrix[i-1,12] + ..., 0) The values in the row i depends on the (i-1)th row only for the 12th column... Is it possible to avoid a "for" loop here? Thank you, Tristan Lorino ---------------------- ?cole Nationale V?t?rinaire d'Alfort - http://www.vet-alfort.fr, T?l. 01 43 96 70 33 M?l. tlorino at vet-alfort.fr Site personnel : http://daedale.free.fr -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._