Message-ID: <CACLi31VgpxT4kbTkCz-VJhuJrF4YbAWO9G_V-JEAU57ZxYOC=w@mail.gmail.com>
Date: 2011-12-15T15:59:16Z
From: Tony Stocker
Subject: Am I misunderstanding loop variable assignment or how to use print()?
In-Reply-To: <CAM_vju=gWKv_v-XG2EGLbtuF0JSzJ90FJO8M_KK9xDMLFyiBTg@mail.gmail.com>
On Thu, Dec 15, 2011 at 10:54, Sarah Goslee <sarah.goslee at gmail.com> wrote:
>
> print(get(x)[["Pr"]]) maybe. Do the get(), then do the subsetting.
>
>
>>>
>>> It's often neater and more efficient to store your anova objects in a
>>> list, though.
>>
>> anything since it's still a set of character strings. ?Could you
>> elaborate a bit on what you mean by storing the anova objects as
>> lists?
>
> Yes: not the names, but the anova objects themselves. Rather than
> creating a bunch of individual objects, store them in a list when
> created:
>
> myanova <- list()
> myanova[["ag.m2529.az"]] <- anova(whatever)
> myanova[["ag.m2529.can"]] <- anova(whatever)
> ...
>
> Then you can quite elegantly use lapply() across all of the anovas at once,
> and don't have so many objects in your workspace.
Okay I'll give that a try and see how it works for me. Thanks for the
suggestion.