On Mon, Mar 7, 2011 at 10:45 PM, Eric Fail <eric.f...@gmx.com> wrote: > Thanks to Gabor Grothendieck and Dennis Murphy I can now solve first > part of my problem and already impress my colleagues with the > R-program below (I know it could be written in a smarter way, but I am > learning). It reads my partly comma separated partly underscore > separated string and cleans it up in a very need way. > > Regardless of my inability to write tight code I moved on to the > second part of my quest, to put it all in to a loop to be able to loop > over my approximately 100 .txt files in /usr2/username/data/ I got > started with list.files() and my loop is more or less working, but I > got stuck on the last cbind part. > > Is there a friendly R-hacker out there that would be willing to take a > look at my loop below*2? >
Create a function Read(filename) which returns the data frame for the indicated file and then do this where fname is the vector of filenames: do.call("rbind", lapply(fname, Read)) ______________________________________________ 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.