Skip to content

Instantly share code, notes, and snippets.

@dholstius
Last active May 18, 2016 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dholstius/2f7b93e3bb0d3a1f10a03e0309176411 to your computer and use it in GitHub Desktop.
Save dholstius/2f7b93e3bb0d3a1f10a03e0309176411 to your computer and use it in GitHub Desktop.
R 3.3 library
# $ brew install libssh2
# $ brew install libgit2
## $ export CMAKE_INCLUDE_PATH="/usr/local/Cellar/libssh2/1.7.0/include"
## $ export CMAKE_LIBRARY_PATH="/usr/local/Cellar/libssh2/1.7.0/lib"
# NOTE: re: git2r: https://github.com/ropensci/git2r/issues/236
install_CRAN <- function (pkg, repos = "http://cran.rstudio.com", verbose = TRUE, ...) {
if (pkg %in% installed.packages()) message(pkg, " is already installed")
else install.packages(pkg, repos = repos, verbose = verbose, ...)
}
install_CRAN("devtools")
install_github <- function (pkg, verbose = TRUE, ...) {
if (pkg %in% installed.packages()) message(pkg, " is already installed")
else devtools::install_github(pkg)
}
install_CRAN("purrr")
install_local <- function (pkg, path = "/Users/dholstius/Dropbox/R-packages", verbose = TRUE, ...) {
if (pkg %in% installed.packages()) message(pkg, " is already installed")
else install.packages(file.path(path, pkg), repos = NULL, type = "source", verbose = verbose, ...)
}
library(purrr)
c("tidyr", "readr", "readxl") %>% map(safely(install_CRAN))
c("flogger", "cacher", "tbltools", "geotools", "Ingres", "inventory") %>% map(safely(install_local))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment