[R] set working directory to current source directory

S Ellison S.Ellison at LGCGroup.com
Fri Aug 17 18:31:03 CEST 2012


 

> Subject: Re: [R] set working directory to current source directory
A windows-centric work-round (assuming .Rdata files are 'associated' with the right R binary n installation) is to save an empty environment  in the relevant project directory with the source file you would normally run. Starting R by clicking on .Rdata file opens R in the right directory to start with. Using relative paths in scripts thereafter then keeps things within the project work area. Starting the first script with rm(list=ls()) guards against inadvertent inclusion of old data (and even apparently 'empty' environments aren't necessarily empty, so I clean up regardless if I start a session that way).

S Ellison

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}




More information about the R-help mailing list