R/install-dat.R

#' Install R package from Dat link
#'
#' Directly install an R package from a Dat link.
#'
#' @param link Dat link
#' @param dir Temporary directory to store download in.
#'
#' @return Console log.
#' @export
#'
#' @examples \dontrun{
#'   install_dat('dat://datr-chris.hashbase.io', dir = tempdir())
#' }

install_dat <- function (link, dir) {
  try_require('devtools', 'install')
  clone_dat(link, dir)

  install(dir)
  unlink(dir, recursive = TRUE)

  message('Successfully installed package from Dat network')
}
libscie/datr documentation built on Sept. 27, 2020, 5:51 p.m.