] merging data list in to single data frame
> filelist = list.files(pattern = "K*cd.txt") # the file names are K1cd.txt
> .to K200cd.txt
It's very easy:
names(filelist) <- basename(filelist)
data_list <- ldply(filelist, read.table, header=T, comment=";&
> filelist = list.files(pattern = "K*cd.txt") # the file names are K1cd.txt
> .to K200cd.txt
It's very easy:
names(filelist) <- basename(filelist)
data_list <- ldply(filelist, read.table, header=T, comment=";", fill=T)
Hadley
--
Assistant Professor / Dobelman Family Junior Cha
2) not a list of 200
data frames? If we can do that then we will able to use this approach.
Thank you so much,
Umesh R
From: Dennis Murphy [mailto:djmu...@gmail.com]
Sent: Monday, April 04, 2011 3:25 PM
To: Umesh Rosyara
Cc: r-help@r-project.org; rosyar...@gmail.com
Subject: Re: [R] mergi
Hi:
Here's an alternative using ldply() from the plyr package. The idea is to
read the data frames into a list, name them accordingly and then call
ldply().
# Read in the test data frames (you want to use list.files() instead to
input the data per Uwe's guidelines)
df1 <- read.table(textConnectio
On 04.04.2011 16:41, Umesh Rosyara wrote:
Dear R community members
I did find a good way to merge my 200 text data files in to a single data
file with one column added will show indicator for that file.
filelist = list.files(pattern = "K*cd.txt")
I doubt you meant "K*cd.txt" but "^K[[:
Dear R community members
I did find a good way to merge my 200 text data files in to a single data
file with one column added will show indicator for that file.
filelist = list.files(pattern = "K*cd.txt") # the file names are K1cd.txt
.to K200cd.txt
data_list <-lapply(f
6 matches
Mail list logo