[R] Indexing a loop-created list

Richard M. Heiberger rmh at temple.edu
Thu Oct 19 17:55:45 CEST 2006


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



More information about the R-help mailing list