Excellent, thanks.
On 28 June 2011 16:36, jim holtman wrote:
> forgot to sent the sapply solution:
>
>> sapply(x, '[', 3)
> Median Median Median Median Median Median Median Median Median Median
> Median Median Median Median Median Median
> 0.4769 0.4880 0.4916 0.4021 0.4474 0.4449 0.5169 0.5067 0
forgot to sent the sapply solution:
> sapply(x, '[', 3)
Median Median Median Median Median Median Median Median Median Median
Median Median Median Median Median Median
0.4769 0.4880 0.4916 0.4021 0.4474 0.4449 0.5169 0.5067 0.5189 0.4088
0.4887 0.5392 0.4964 0.4141 0.5155 0.4461
Median Median Medi
single brackets:
> x <- as.list(100)
> for(loop in c(1:100)) {
+ x[[loop]] <- summary(runif(100))
+ }
> x[[1]][1]
Min.
0.007595
> x[[1]][3]
Median
0.4769
>
On Tue, Jun 28, 2011 at 7:22 PM, Jeremy Miles wrote:
> Hi All,
>
> I want to extract elements of elements in a list.
>
0.5812 0.4789 0.5674 0.4995
>
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Jeremy Miles
Sent: Wednesday, 29 June 2011 9:23 AM
To: r-help
Subject: [R] Extract elements from objects in a list
Hi All,
I want to extract
Hi All,
I want to extract elements of elements in a list.
Here's an example of what I mean:
If I create a list:
x <- as.list(100)
for(loop in c(1:100)) {
x[[loop]] <- summary(runif(100))
}
> head(x)
[[1]]
Min. 1st Qu. MedianMean 3rd Qu.Max.
0.02271 0.25260 0.58130
5 matches
Mail list logo