Re: [R] Path to R script

2010-05-13 Thread Sharpie
Johannes W. Dietrich wrote: > > At 19:29 Uhr -0400 12.05.2010, Gabor Grothendieck wrote: >>If you are running the file via source("myfile.R") then just put this >>in the file: >> >>this.dir <- dirname(sys.frame(1)$ofile) >> >>This is a bit fragile since changes to the internals of source could >

Re: [R] Path to R script

2010-05-13 Thread Shi, Tao
In this case, deploy them as a R package is the way to go. - Original Message > From: Johannes W. Dietrich > To: "Shi, Tao" ; johannes.dietr...@rub.de > Cc: r-help@r-project.org > Sent: Thu, May 13, 2010 9:14:24 AM > Subject: Re: [R] Path to R scrip

Re: [R] Path to R script

2010-05-13 Thread Johannes W. Dietrich
At 19:29 Uhr -0400 12.05.2010, Gabor Grothendieck wrote: If you are running the file via source("myfile.R") then just put this in the file: this.dir <- dirname(sys.frame(1)$ofile) This is a bit fragile since changes to the internals of source could break it but it does currently work. Great,

Re: [R] Path to R script

2010-05-13 Thread Johannes W. Dietrich
At 13:19 Uhr -0700 12.05.2010, Shi, Tao wrote: Don't quite understand your question, but it looks like a more IT issue to me. I guess you store your R scripts in a central location (e.g. a server) and everybody call them from their own workstation, right? Thank you, but this would be an easy

Re: [R] Path to R script

2010-05-12 Thread Gabor Grothendieck
If you are running the file via source("myfile.R") then just put this in the file: this.dir <- dirname(sys.frame(1)$ofile) This is a bit fragile since changes to the internals of source could break it but it does currently work. On Wed, May 12, 2010 at 3:31 PM, Johannes W. Dietrich wrote: > The

Re: [R] Path to R script

2010-05-12 Thread David Scott
David Scott wrote: Sharpie wrote: Johannes W. Dietrich wrote: There is certainly a trivial solution for my question, but I can't find the answer in the documentation. I need a platform independent method to obtain the file path of the current R script. My working group uses R on several ma

Re: [R] Path to R script

2010-05-12 Thread David Scott
Sharpie wrote: Johannes W. Dietrich wrote: There is certainly a trivial solution for my question, but I can't find the answer in the documentation. I need a platform independent method to obtain the file path of the current R script. My working group uses R on several machines with differe

Re: [R] Path to R script

2010-05-12 Thread Sharpie
Johannes W. Dietrich wrote: > > There is certainly a trivial solution for my question, but I can't > find the answer in the documentation. > > I need a platform independent method to obtain the file path of the > current R script. > > My working group uses R on several machines with differen

Re: [R] Path to R script

2010-05-12 Thread Shi, Tao
Don't quite understand your question, but it looks like a more IT issue to me. I guess you store your R scripts in a central location (e.g. a server) and everybody call them from their own workstation, right? Or you can always bundle your R scripts into a package and distribute it around your

Re: [R] Path to R script

2010-05-12 Thread Duncan Murdoch
On 12/05/2010 3:31 PM, Johannes W. Dietrich wrote: There is certainly a trivial solution for my question, but I can't find the answer in the documentation. I need a platform independent method to obtain the file path of the current R script. My working group uses R on several machines with d

Re: [R] Path to R script

2010-05-12 Thread Erik Iverson
While not a direct answer to your question, do ?getwd and ?setwd help at all? Johannes W. Dietrich wrote: There is certainly a trivial solution for my question, but I can't find the answer in the documentation. I need a platform independent method to obtain the file path of the current R scr