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

Hadley Wickham h.wickham at gmail.com
Thu Sep 27 09:31:40 CEST 2012


>> > 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.

Also, something that Duncan was probably thinking but didn't mention,
is that creating a package is really really easy - all you need to do
is put your R files in a directory called R and create a description
file that says what the package does, who's allowed to use it (the
license), who to contact if there are problems (author/maintainer) and
what other packages it requires (depends/imports).

Hadley

-- 
RStudio / Rice University
http://had.co.nz/




More information about the R-help mailing list