}
> 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"
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
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
3 matches
Mail list logo