[R] merging data list in to single data frame

Hadley Wickham hadley at rice.edu
Tue Apr 5 00:10:44 CEST 2011

> 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)


Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University

More information about the R-help mailing list