R/utils.R

Defines functions is_pkg load_object

#' @importFrom utils head
load_object <- function(file) {
  tmp_env <- new.env()
  load(file = file, envir = tmp_env)
  tmp_env[[ls(tmp_env)[1]]]
}

is_pkg <- function(){
  return(file.exists(file.path(getwd(), "DESCRIPTION")) &&
           file.exists(file.path(getwd(), "NAMESPACE"))
  )
}

Try the washr package in your browser

Any scripts or data that you put into this service are public.

washr documentation built on April 4, 2025, 1:10 a.m.