Re: [R] Indexing a loop-created list

From: Richard M. Heiberger <rmh_at_temple.edu>
Date: Thu 19 Oct 2006 - 15:55:45 GMT


m <- 2
n <- 3

matlist <- matrix(vector("list"), m, n)

for (i in 1:m)
  for (j in 1:n)
    matlist[[i,j]] <- matrix(sample(12), 3, 4)

matlist[[1,2]] ## access with double[[ subscripts



R-help@stat.math.ethz.ch 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. Received on Fri Oct 20 05:27:36 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 19 Oct 2006 - 19:30:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.