[R] modifying a package installed via GitHub

Charles Determan cdetermanjr at gmail.com
Mon Jul 20 14:52:55 CEST 2015


Steve,

You are able to work with a github package the same as any github repo.  If
you clone the repo:

git clone https://github.com/user/repo.git

If using RStudio it is simple enough to create a new project in that new
directory (if the .Rproj file does not exist, otherwise open that).  Once
you have the project open for that directory you can modify source files
and rebuild and install as you like.  If at the CMD line, you do as Bob
instructed with R CMD install .

I recommend, however, either creating a new branch for you changes (if you
familiar with git management) or at least make sure to change the
subversion of the package so it doesn't conflict with the 'original'.  That
way you 'know' which version of the package is installed at a given time.

Naturally, if you feel your modifications are valuable you may want to
actually fork the package on github and create a pull request of your
changes for the maintainer to incorporate in to the next release.

Hope this helps clarify things,

Charles



On Sat, Jul 18, 2015 at 8:49 AM, boB Rudis <bob at rudis.net> wrote:

> You can go to the package directory:
>
>     cd /some/path/to/package
>
> and do
>
>     R CMD install .
>
> from a command-line there.
>
> Many github-based packages are also made using RStudio and you can
> just open the .Rproj file (i.e. load it into R studio) and build the
> package there which will install it.
>
> The same-named package will overwrite what you have previously installed.
>
> Just:
>
>    devtools::install_github("owner/package")
>
> to go back to the original.
>
> On Fri, Jul 17, 2015 at 8:12 PM, Steve E. <searl at vt.edu> wrote:
> > Hi Folks,
> >
> > I am working with a package installed via GitHub that I would like to
> > modify. However, I am not sure how I would go about loading a 'local'
> > version of the package after I have modified it, and whether that process
> > would including uninstalling the original unmodified package (and,
> > conversely, how to uninstall my local, modified version if I wanted to go
> > back to the unmodified version available on GitHub).
> >
> > Any advice would be appreciated.
> >
> >
> > Thanks,
> > Steve
> >
> >
> >
> > --
> > View this message in context:
> http://r.789695.n4.nabble.com/modifying-a-package-installed-via-GitHub-tp4710016.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > ______________________________________________
> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list