By doing peak <- list() you initialize a list and then you are adding the
data objects to the list in the for loop.To access each data object just go:
peaks[[i]]
Where i is in [1,100].  This will return the data object you want.

Adrian

On Tue, Apr 28, 2009 at 11:23 PM, Taylor Hermes <trher...@gmail.com> wrote:

> It seems that this addition works, but has created just one object
> called 'peak' with all the data from those 100 files.  I'd like each
> file to have a corresponding object containing the data.
>
> Thanks for your help!
>
>
> On Tue, Apr 28, 2009 at 19:43, Zeljko Vrba <zv...@ifi.uio.no> wrote:
> > On Tue, Apr 28, 2009 at 07:09:04PM -1000, Taylor Hermes wrote:
> >>
> >> I tried the following:
> >>
> > Add this before for():
> >
> > peak <- list()
> >
> >> for (i in 1:100) {
> >>       peak[[i]] <- read.table(paste(i,"--one--hist.txt", sep=""),
> sep=",",
> >> header=TRUE)
> >> }
> >>
> >
> >
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to