How to install development version of R packages github repository

RGithubGgplot2

R Problem Overview


How can I install a package that is under development directly from a github repository and once installed how can I switch between development and CRAN versions?

The specific package I am interested in installing from git is ggplot2.

R Solutions


Solution 1 - R

via Hadley at https://github.com/hadley/ggplot2

> install.packages("devtools") >
> library(devtools) >
> dev_mode(on=T) >
> install_github("hadley/ggplot2") >
> # use dev ggplot2 now >
> # when finished do: >
> dev_mode(on=F) #and you are back to having stable ggplot2

Solution 2 - R

I have the feeling that both previous answers miss the point of your question.

Consider this:

  • You can control where to install packages via arguments to both R CMD INSTALL (via -l) and install.packages().

  • At run-time, you can control where to load packages from via .libPaths().

So it really is just a matter of setting a few variables in your .Rprofile (or alike) to control this.

Solution 3 - R

for compile binaries install:

install.packages('xxx', repo='http://repo_adress')

for source install :

install.packages('xxx', repo='http://repo_adress', type='source')

Solution 4 - R

devtools::install_github("ggplot2")

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEtienne Low-DécarieView Question on Stackoverflow
Solution 1 - RSethView Answer on Stackoverflow
Solution 2 - RDirk EddelbuettelView Answer on Stackoverflow
Solution 3 - Rb_rousseauView Answer on Stackoverflow
Solution 4 - RferrelwillView Answer on Stackoverflow