Re: [R] indexing names for looping across computations done on pairs of matrices

2014-04-16 Thread Cade, Brian
A.K. Wonderful - thank you. The last set of code using sapply(), seq_along(), and get() worked like a charm and was what I was missing. Brian Brian S. Cade, PhD U. S. Geological Survey Fort Collins Science Center 2150 Centre Ave., Bldg. C Fort Collins, CO 80526-8818 email: ca...@usgs.gov t

Re: [R] indexing names for looping across computations done on pairs of matrices

2014-04-15 Thread arun
Hi, If the two pairs of matrices are in a list: set.seed(42) lst1 <- lapply(1:11, function(x) matrix(sample(40, 20, replace=TRUE), 5,4)) names(lst1) <- paste0("gs", paste0("4.",seq(0,100,by=10))) set.seed(585) lst2 <- lapply(1:11, function(x) matrix(sample(40, 20, replace=TRUE), 5,4)) names

[R] indexing names for looping across computations done on pairs of matrices

2014-04-15 Thread Cade, Brian
So I know I must be missing something simple and obvious for the following data manipulation where I have (in this example) 11 pairs of matrices (gs4.0 to gs4.100 and ps1.0 to ps1.100) from some population simulations (all with same dimensions) where I want to get some summary statistics on the pro