This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("devtools") # with_lib(), install_github() | |
tmp_lib <- file.path(tempdir(), ".lib") | |
dir.create(tmp_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 = "http://cran.rstudio.com")) | |
## but this could also be a downgrade to the CRAN/released version! |