Skip to content

Instantly share code, notes, and snippets.


Zhian N. Kamvar zkamvar

View GitHub Profile
View 2014-11-18_install-github-tmp-lib.r
library("devtools") # with_lib(), install_github()
tmp_lib <- file.path(tempdir(), ".lib")
cran_pkg <- function(pkg, tmp_lib = tmp_lib){
## upgrade or downgrade a package here
## following example is upgrading to bleeding edge devel version
with_lib(tmp_lib, install.packages(pkg, repos = ""))
## but this could also be a downgrade to the CRAN/released version!