On 12-09-27 3:31 AM, Hadley Wickham wrote:
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).
I would usually do more than that: I find the R documentation system
helpful even when I'm the only user of a package (and there are the
prompt* functions for quickly creating it, as well as package.skeleton
to set things up at the beginning). Vignettes are a great way to
organize and document things that are done via scripts. And if you want
to include compiled C or C++ or Fortran code, packages are drastically
easier to manage than other approaches.
Duncan Murdoch
______________________________________________
R-help@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.