Re: [R] How to load load multiple text files and order by id

2011-03-05 Thread Dennis Murphy
Hi: This is basically Scott's idea with a few added details. Let's assume your files have similar names - e.g., they differ only by number. The example below creates ten files of similar structure to yours. There are then two paths one can follow: (1) put all the files into a specific directory,

Re: [R] How to load load multiple text files and order by id

2011-03-05 Thread Scott Chamberlain
Hi Richard, This may be a bit ugly, but it should work if you have all your files in a folder you are calling from. Use dir() within the lapply call in combination with read.table as the function require(plyr) setwd("/Mac/R_stuff/files") # where your files are in this directory, and no files y

Re: [R] How to load load multiple text files and order by id

2011-03-05 Thread Kingsley G. Morse Jr.
Hi Richard, If you haven't tried it already, maybe you could read the files into separate data frames with read.table(), and then combine them with merge(). Type ?merge to learn more. Good luck, Kingsley On 03/05/11 18:39, Richard Green wrote: > Hello R users, > I am fairly new to R and w

[R] How to load load multiple text files and order by id

2011-03-05 Thread Richard Green
Hello R users, I am fairly new to R and was hoping you could point me in the right direction I have a set of text files (36). Each file has only two columns (id and count) , I am trying to figure out a way to load all the files together and then have them ordered by id into a matrix data frame. For