R/move_to.R

Defines functions move_to

Documented in move_to

#' Systematic Saving of R Objects
#'
#' @export
move_to <- function(.object, .path, here = TRUE, session = TRUE) {

  if (here) .path <- c(here::here(), .path) |> as.list()
  if (session) attr(.object, "session") <- devtools::session_info()

  .object |>
    readr::write_rds(do.call(fs::path, .path))
}
fdeoliveirag/taxbr documentation built on Sept. 25, 2022, 2:54 a.m.