Re: [R] setting the current working directory to the location of the source file

From: Marcin Gomulka <mrgomel_at_gmail.com>
Date: Sun, 13 Jun 2010 15:01:57 +0200

On Fri, Jun 11, 2010 at 11:30 AM, Henrik Bengtsson <hb_at_stat.berkeley.edu>wrote:

> Isn't this what source(..., chdir=TRUE) is for? See help(source).
>
>
not really. Imagine you give someone a script, but you have no control over where and how they run it. They shouldn't be required to put in the chdir parameter.
Say, the script outputs a plot to a file (pdf,png,...) and you want the file to be created next to the source script, as the user would expect it.

mg.

        [[alternative HTML version deleted]]



R-help_at_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. Received on Sun 13 Jun 2010 - 13:03:50 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 13 Jun 2010 - 13:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive