Thats it Hadley!!!
Thank you.
--
View this message in context:
http://n4.nabble.com/read-multiple-large-files-into-one-dataframe-tp891835p1290089.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https:
On Mon, Jan 25, 2010 at 4:43 AM, Paul Hiemstra wrote:
> Brad Patrick Schneid wrote:
>>
>> ### The following is very helpful # listOfFiles <-
>> list.files(pattern= ".txt") d <- do.call(rbind, lapply(listOfFiles,
>> read.table)) ###
>>
>> but what if each file c
Brad Patrick Schneid wrote:
### The following is very helpful #
listOfFiles <- list.files(pattern= ".txt")
d <- do.call(rbind, lapply(listOfFiles, read.table))
###
but what if each file contains information corresponding to a different
subject and I need t
### The following is very helpful #
listOfFiles <- list.files(pattern= ".txt")
d <- do.call(rbind, lapply(listOfFiles, read.table))
###
but what if each file contains information corresponding to a different
subject and I need to be able to tell where each
A few points to consider:
- If all the data are numeric, then use matrices instead of data frames.
- With either data frames or matrices, there is no way (that I'm aware
of anyway) in R to stack them without making at least one copy in
memory.
- Since none of the files has a header row, I would
HTH
Simon.
- Original Message -
From: "SYKES, Jennifer"
To:
Sent: Wednesday, May 13, 2009 11:45 AM
Subject: [R] read multiple large files into one dataframe
Hello
Apologies if this is a simple question, I have searched the help and
have not managed to work out a solution.
What types of data are in each file? All numbers, or a mix of numbers
and characters? Any missing data or special NA values?
On Wed, May 13, 2009 at 7:45 AM, SYKES, Jennifer
wrote:
> Hello
>
>
>
> Apologies if this is a simple question, I have searched the help and
> have not managed to work out
I'd first try plyr and see if it's efficient enough,
library(plyr)
listOfFiles <- list.files(pattern= ".txt")
d <- ldply(listOfFiles, read.table)
str(d)
alternatively,
d <- do.call(rbind, lapply(listOfFiles, read.table))
HTH,
baptiste
On 13 May 2009, at 12:45, SYKES, Jennifer wrote:
Hello
Apologies if this is a simple question, I have searched the help and
have not managed to work out a solution.
Does anybody know an efficient method for reading many text files of the
same format into one table/dataframe?
I have around 90 files that contain continuous data over 3 mont
9 matches
Mail list logo