Thank you very much.
--
View this message in context:
http://r.789695.n4.nabble.com/Batch-importing-data-tp4592997p4602378.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/l
On Apr 27, 2012, at 1:30 PM, R. Michael Weylandt wrote:
list.files() will give you all the file names in your working
directory (you can also give it a pattern argument) then can loop over
those with something like:
lapply(list.files(), read.table)
which will put all your files in a list obje
list.files() will give you all the file names in your working
directory (you can also give it a pattern argument) then can loop over
those with something like:
lapply(list.files(), read.table)
which will put all your files in a list object. This is generally
considered much more convenient than t
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 wrote:
> It
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 wrote:
> On Tue, Apr 28, 2009 at 07:0
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)
> }
>
_
6 matches
Mail list logo