A simple question: How to extract multiple data from lists with multiple entries.
> data
[[1]]
a b p d e f g h i j k l m n
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4
[[2]]
a b p d e f g h i j k l m n
0.4 0.2 0.5 0.4 0.8 1.6 0.5 0.8 0.1 1.9 1.3 2.2 1.3 1.4
[[3]]
a b p d e f g h i j k l m n
0.6 0.8 2.3 3.4 1.5 2.6 1.7 1.8 0.8 1.5 1.0 1.0 1.4 1.6
[[4]]
a b p d e f g h i j k l m n
0.5 0.1 0.8 1.4 1.5 1.6 2.7 0.8 0.9 1.9 1.2 1.3 1.5 1.0
There are actually 1000 lists (only shown 4 for simplicity). The a, b, p, ..., n are actually names that I have given in another function which returns
return(c("a" = a, "b" = b, ..., "n" = n))
How do I extract so that I will get the following results
#For a values
> data$a
0.1 0.4 0.6 0.5
#For b values
> data$b
0.2 0.2 0.8 0.1
I am also open to changing the list to matrices or vectors and then extracting them. Any method that works are welcome. Thank you.