Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install development version of R packages github repository

Tags:

github

r

ggplot2

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.

like image 289
Etienne Low-Décarie Avatar asked Mar 11 '12 14:03

Etienne Low-Décarie


People also ask

How do I install a newer version of a package in R?

If you only want to update a single package, the best way to do it is using install. packages() again. In RStudio, you can also manage packages using Tools -> Install Packages.

How do I get an R code from GitHub?

The most direct way to get data from Github to your computer/ into R, is to download the repository. That is, click the big green button: The big, green button saying “Clone or download”, click it and choose “download zip”. Of course, for those using Git and Github, it would be appropriate to clone the repository.


1 Answers

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 
like image 51
Seth Avatar answered Oct 26 '22 22:10

Seth