Skip to content
Prev 280318 / 398506 Next

Am I misunderstanding loop variable assignment or how to use print()?

Hi,
On Thu, Dec 15, 2011 at 10:43 AM, Tony Stocker <akostocker at gmail.com> wrote:
print(get(x)[["Pr"]]) maybe. Do the get(), then do the subsetting.
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.

Sarah