[R] Indexing lists

Adaikalavan Ramasamy ramasamy at cancer.org.uk
Thu Sep 16 14:15:25 CEST 2004


m <- matrix(1:9, nc=3)
a <- list(m, m+10, m+100, m+1000)
sapply(a, function(mat) mat[1,1])
 [1]    1   11  101 1001


On Thu, 2004-09-16 at 12:33, Perez Martin, Agustin wrote:
> DeaR useRs:
>  
> I have a list with 500 elements, in each other there are data.frames and I
> want to take the first row and the first column of each elements of my list
> since the first to the 500-th.
>  
> Thanks and excuse my bad English.
> 
> ---
> 
> 
> 
>  
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list