Re: [R] merging data list in to single data frame

2011-04-04 Thread Umesh Rosyara
] 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=";&

Re: [R] merging data list in to single data frame

2011-04-04 Thread Hadley Wickham
> 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

Re: [R] merging data list in to single data frame

2011-04-04 Thread Umesh Rosyara
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

Re: [R] merging data list in to single data frame

2011-04-04 Thread Dennis Murphy
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

Re: [R] merging data list in to single data frame

2011-04-04 Thread Uwe Ligges
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[[:

[R] merging data list in to single data frame

2011-04-04 Thread Umesh Rosyara
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