Gundala Viswanath wrote:
Thanks so much Erik,

But how do you include that in a loop.

I tried this, doesn't seem to work. Please advice:

__BEGIN__
all_mat <- NULL

for (matno in 1:10) {

    mat <- process_to_create_matrix(da[matno])
    all_mat <- list(all_post, matno = mat)

}


I'm not exactly sure what you're up to, what is all_post, and what is "da"?

You might look at the lapply function as an option for avoiding the loop and writing cleaner code.

Something like:

all_mat <- lapply(da, process_to_create_matrix)

may or may not work depending on what "da" is.

Please see the footer of this message regarding reproducible, self-contained example code.

Best,
Erik

______________________________________________
R-help@r-project.org 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.

Reply via email to