R/TempDir.R

Defines functions TempDir

Documented in TempDir

#' Create a new temp dir
#' @export TempDir
TempDir <- function() {
  time <- as.character(Sys.time())
  time <- gsub("[\\: ]", "-", time)
  rand <- as.character(stats::runif(1))
  rand <- gsub("[\\. ]", "", rand)
  dir.create(t <- file.path(
    tempdir(),
    sprintf(
      "%s-%s-%s",
      time,
      Sys.getpid(),
      rand
    )
  ))

  return(t)
}
raubreywhite/RAWmisc documentation built on May 27, 2019, 2:04 a.m.