[R] How do I access a specific element of a multi-dimensional list

Knut Hansen knut.hansen at uit.no
Fri Feb 20 13:18:22 CET 2015


Dear list,

Let's say I have setup the following list:
a = c(2, 3, 5) 
b = c("aa", "bb", "cc") 
c = c(TRUE, FALSE, TRUE) 

x = list(a, b, c)

I want to access the first second dimension element of each first dimension 
element so that the result is something like:
(2, "aa", TRUE)

In my real life problem the list is about 350 elements in the first dimension 
so the solution must handle that.

Sincerely
Knut Hansen



More information about the R-help mailing list