Re: [R] iterative extracting data from a list without keys

2013-03-07 Thread Bert Gunter
Re-read ?"[" (always better to read the docs before archives...) and note in particular: "[[ can be applied recursively to lists, so that if the single index i is a vector of length p, alist[[i]] is equivalent to alist[[i1]]...[[ip]] providing all but the final indexing results in a list." I agr

Re: [R] iterative extracting data from a list without keys

2013-03-07 Thread arun
Hi, Try this: betas<- c(0.01,0.01,0.01) LData<- list(int=rep(1,10), date= matrix(c(152:161,163:168,162:165),nrow=2,ncol=10,byrow=TRUE), land=c(rep(0,4),1,0,1,1,0,0))  betas2<- c(0.01,1,2) mapply(`*`,LData,betas2) #$int # [1] 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 #$date # [,1] [,