R/clean_model_dir.R

Defines functions clean_model_dir

Documented in clean_model_dir

#' Clean ezcox Model File Directory
#'
#' @inheritParams ezcox
#'
#' @return nothing
#' @export
#'
#' @examples
#' \donttest{
#' clean_model_dir()
#' }
#' @testexamples
#' expect_message(clean_model_dir(), "Done")
clean_model_dir <- function(model_dir = file.path(tempdir(), "ezcox")) {
  if (dir.exists(model_dir)) {
    message("Cleaning...")
    z <- unlink(model_dir, recursive = TRUE)
  } else {
    message("Path does not exist, skipping...")
  }
  message("Done")
}

Try the ezcox package in your browser

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

ezcox documentation built on Oct. 28, 2021, 5:08 p.m.