[R] Is there a way to source from a specific Git repository without hardcoding the location everywhere?

Daniel Nordlund djnordlund at frontier.com
Thu Sep 27 17:57:54 CEST 2012


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
> On Behalf Of Curt Seeliger
> Sent: Wednesday, September 26, 2012 5:51 PM
> To: r-help at r-project.org
> Subject: Re: [R] Is there a way to source from a specific Git repository
> without hardcoding the location everywhere?
> 
> Duncan Murdoch <murdoch.duncan at gmail.com> wrote on 09/26/2012 05:35:00 PM:
> > > ...
> > > I'd like to have the code source files from the 'local' git repository
> > > without modification, where 'local' could mean c:\yada\ for one
> person,
> > > m:\my documents\wetlands\ for another, and
> l:\foo\bar\sharedRemote\wet\ to
> > > another user.
> > > ...
> >
> > Yes.  Use
> >
> > library(myProject)
> >
> > where myProject is a package containing all the scripts, written as
> > functions.
> 
> Yes, the eventual fate of these functions is expected to be a package. I'd
> like the pushed/pulled code to be runable as is without an intermediate
> step of package creation or gsub()ing hardcoded paths.
> 
> Thanks for the quick reply,
> cur
> 
> --
> Curt Seeliger, Data Ranger
> Raytheon Information Services - Contractor to ORD
> seeliger.curt at epa.gov
> 541/754-4638

Curt,

each user could set a PROJECT_PATH environment variable on the local machine, and then project script files could contain the code

setwd(Sys.getenv(c('PROJECT_PATH')))


Hope this is helpful,

Dan

Daniel Nordlund
Bothell, WA USA
 




More information about the R-help mailing list