Re: [R] Looping through rows of all elements of a list that has variable length

2013-02-04 Thread Dimitri Liakhovitski
} > out[[gridrow]]=sum_rows > } > > Pratap > > --- On *Sun, 3/2/13, Dimitri Liakhovitski > * wrote: > > > From: Dimitri Liakhovitski > Subject: [R] Looping through rows of all elements of a list that has > variable length > To: "r-help"

Re: [R] Looping through rows of all elements of a list that has variable length

2013-02-04 Thread nalluri pratap
grid)) {   sum_rows=0    for (i in seq_along(mygrid))   {     myrow<-mygrid[gridrow,i]     sum_rows=sum_rows+sum(l.long[[i]][myrow,])   }   out[[gridrow]]=sum_rows }   Pratap --- On Sun, 3/2/13, Dimitri Liakhovitski wrote: From: Dimitri Liakhovitski Subject: [R] Looping through row

[R] Looping through rows of all elements of a list that has variable length

2013-02-03 Thread Dimitri Liakhovitski
Dear R-ers, I have a list of data frames such that the length of the list is unknown in advance (it could be 1 or 2 or more). Each element of the list contains a data frame. I need to loop through all rows of the list element 1 AND (if applicable) of the list element 2 etc. and do something at each