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

From: Hadley Wickham <hadley_at_rice.edu>
Date: Mon, 04 Apr 2011 17:10:44 -0500

> 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 Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
R-help_at_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.
Received on Mon 04 Apr 2011 - 22:12:51 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 05 Apr 2011 - 01:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive