Re: [R] opening files in directory

2006-09-04 Thread Gabor Grothendieck
On 9/4/06, Mike Nielsen <[EMAIL PROTECTED]> wrote: > R won't do variable interpolation inside quotation marks as perl does. Just as an aside, gsubfn in package gsubfn will do perl-style (well, sort of) string interpolation: > library(gsubfn) > i <- 1 > gsubfn(x = "data_files/file$i") [1] "data_fi

Re: [R] opening files in directory

2006-09-04 Thread Mike Nielsen
R won't do variable interpolation inside quotation marks as perl does. You could try amending your code with, for e.g. file.name<-paste(sep="/","data_files",files[[i]]) x<-read.table(file.name) Regards, Mike On 9/4/06, Ffenics <[EMAIL PROTECTED]> wrote: > Hi there > I want to be able to take a

Re: [R] opening files in directory

2006-09-04 Thread Ffenics
Yes, already looked at the FAQ. Thats how I have got where I am. I didnt see a solution to this particular problem on there though Thanks anyway. Uwe Ligges <[EMAIL PROTECTED]> wrote: FAQ ... Uwe Ligges Ffenics wrote: > Hi there > I want to be able to take all the files in a given directory,

Re: [R] opening files in directory

2006-09-04 Thread Uwe Ligges
FAQ ... Uwe Ligges Ffenics wrote: > Hi there > I want to be able to take all the files in a given directory, read them in > one at a time, calculate a distance matrix for them (the files are data > matrices) and then print them out to separate files. This is the code I > thought I would be a