Re: [R] Reading tables using a truncated name

2008-11-11 Thread hadley wickham
Which can be simplified to: paths <- dir(path = filePath, pattern = "^test_", full = T) lapply(paths, read.csv) Hadley On Tue, Nov 11, 2008 at 2:01 PM, <[EMAIL PROTECTED]> wrote: > Hi all, > > Thanks everyone for your advice. They have been helpful. > > Just for the record, I am using ... > > l

Re: [R] Reading tables using a truncated name

2008-11-11 Thread chibco
Hi all, Thanks everyone for your advice. They have been helpful. Just for the record, I am using ... lapply(dir(path = filePath, pattern = "^test_"), function(x){read.table(file = paste(filePath, x, sep = ""), sep = ",", header = TRUE) } ) to load the files kind regards Chibisi On Tue, Nov

Re: [R] Reading tables using a truncated name

2008-11-11 Thread Dieter Menne
gmail.com> writes: > I am trying to read a bunch of csv files using read.table() that are named > "test_xx.csv" where "xx" has no particular pattern. Is there a way > of reading all the files by specifying a truncated file name e.g. "test_" > with some wild card characters, or would I ha

Re: [R] Reading tables using a truncated name

2008-11-11 Thread Henrique Dallazuanna
Try this: sapply(dir(patt="^test_"), read.table, sep = ";", header = TRUE) On Tue, Nov 11, 2008 at 3:06 PM, <[EMAIL PROTECTED]> wrote: > Dear all, > > I am trying to read a bunch of csv files using read.table() that are named > "test_xx.csv" where "xx" has no particular pattern. Is there

Re: [R] Reading tables using a truncated name

2008-11-11 Thread hadley wickham
?dir Hadley On Tue, Nov 11, 2008 at 11:06 AM, <[EMAIL PROTECTED]> wrote: > Dear all, > > I am trying to read a bunch of csv files using read.table() that are named > "test_xx.csv" where "xx" has no particular pattern. Is there a way > of reading all the files by specifying a truncated fi