Dear R help list, I am very new to R and I apologize in advance if this has been answered before. I have done my best to google/R search what I need but no luck. Here is what I am attempting:
I have hundreds of .csv files that I need to sort based on a single column of alphanumeric data. All of the files contain matrices that have identical dimensions and headers, however the data table doesn't begin until the 74th line in each file. Doing some searching, I have been able to create an object with elements consisting of each file in the folder containing the targets (please note this is my working directory): filenames<-list.files() alldata<-lapply(filenames, read.csv, skip=73, header=TRUE) At this point I believe I have created an object with N elements (where N=# files in the wd), each containing the matrix I am attempting to sort. I am completely lost as to how I can sort each matrix based on a single column (say, "Name") and then either overwrite the source files or write to a new directory all of the sorted data. I half wonder if I should be creating individual objects for each file that I read in, but I haven't been able to figure this out either. Please note that I am trying to sort these files individually - would a loop be more efficient? I appreciate the help, BustedAvi [[alternative HTML version deleted]] ______________________________________________ R-help@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.