Here's a slight modification that is even faster if speed is a consideration:
sapply(Version1_, `[[`, "First")
The thought process is to go through the list "Version1_" and apply
the operation `[[` to each element individually. This requires a
second operator (here the element name "First") which
Great, this worked the fastest of all the suggestions. Cheers,
Josh
From: Michael Weylandt [via R] [mailto:ml-node+s789695n414494...@n4.nabble.com]
Sent: Thursday, December 01, 2011 8:11 PM
To: ROLL Josh F
Subject: Re: Summarizing elements of a list
Similarly, t
Thank you for the help, I knew it could be done with a member of the apply
family. I struggle with apply stuff though, its not always intuitive for me
with these functions.
Cheers,
JR
From: Sarah Goslee [via R] [mailto:ml-node+s789695n414453...@n4.nabble.com]
S
Similarly, this might work:
unlist(lapply(Version1_, `[`,"First"))
Michael
On Thu, Dec 1, 2011 at 9:41 PM, Sarah Goslee wrote:
> How about:
>
> lapply(Version1_, subset, subset=c(TRUE, FALSE))
> or sapply() depending on what you want the result to look like.
>
> Thanks for the reproducible exam
How about:
lapply(Version1_, subset, subset=c(TRUE, FALSE))
or sapply() depending on what you want the result to look like.
Thanks for the reproducible example.
Sarah
On Thu, Dec 1, 2011 at 5:17 PM, LCOG1 wrote:
> Hi everyone,
> I looked around the list for a while but couldn't find a soluti
Hi everyone,
I looked around the list for a while but couldn't find a solution to my
problem. I am storing some results to a simulation in a list and for each
element i have two separate vectors(is that what they are called, correct my
vocab if necessary). See below
Version1_<-list()
for(i in
Someone is bound to know a better way, but...
subset(unlist(Version1_), subset=names(unlist(Version1_))=="First")
LCOG1 wrote
>
> Hi everyone,
>I looked around the list for a while but couldn't find a solution to my
> problem. I am storing some results to a simulation in a list and fo
7 matches
Mail list logo