Hi, I am pretty new to R and I would apreciatte very much your help to solve my problem. I have 40 csv files that have the same structure, and I want to merge them into a single data frame.
I already have load and combined all the cvs files into a large list, and I created two filenames <- list.files('data',full.names=TRUE) All_data <- lapply(filenames,function(i){ ###read cvs files and add the row and column names to each data frame### read.csv(i, header=FALSE, sep = "", col.names = col_names, row.names = row_names) }) However I would like to sum the rows of cvs files to get a single data frame (each cvs file has 47 rows and colunms, so the final data frame should have the same). I could only do it one by one data data frame, but I was wondering if anyone could give an idea of how to write a function for this. Thanks, Alejandra [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.