R/atomizer.R

Defines functions atomizer

Documented in atomizer

#' atomizer
#'
#' @export
#' @param path_ref path to reference package, end of path is pkg name
#' @param path_new path to new package, end of path is pkg name
#' @param funcs function(s) to extract
#' @examples \dontrun{
#' atomizer(path_ref = "../rredlist", path_new = "../foobar", funcs = "rl_citation")
#' devtools::install("../foobar")
#' library("foobar")
#' foobar::rl_citation()
#' }
atomizer <- function(path_ref, path_new, funcs) {
  res <- scattalyze(path_ref)
  fout <- find_deps(res, fxns = funcs)
  g <- extract_funcs(path_ref, fout)
  xx <- get_imports(path_ref, fout)
  write_pkg(path = path_new, fxns = g, imports = xx)
}
ropenscilabs/atomize documentation built on Aug. 20, 2020, 3:55 p.m.