Skip to content
Back to formatted view

Raw Message

Message-ID: <CAH7sKSO9OW9bVCDjBgBVbAp_Lu=EEmYSFtS-u7yLAAWrrwA-Rg@mail.gmail.com>
Date: 2012-08-14T00:50:47Z
From: Kenn Konstabel
Subject: set working directory to current source directory
In-Reply-To: <CAGuusR_AE6Z6PVod95Ypf8wbmj+V5rTnFKqPQW+=SZkA0PjaXg@mail.gmail.com>

When you close R it asks whether to save the workspace. I often say
"yes" and later start R by double clicking on that workspace (named
.Rdata) -- then the wd is automatically set. Alternatively you can
have setwd("X:/some/thing") at the beginning of your source file.

On Tue, Aug 14, 2012 at 3:40 AM, Sachinthaka Abeywardana
<sachin.abeywardana at gmail.com> wrote:
> Hi all,
>
> Is there a way to get cran R to set the working directory to be wherever
> the source file is? Each time I work on a project on different computers I
> keep having to set the working directory which is getting quite annoying.
>
> Thanks,
> Sachin
>
>         [[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.