tests/testthat/helper-help.R

library(stringr)
library(proto)

copy_file_to_temp <- function(f_name) {
  folder <- tempdir()
  f_dest <- file.path(folder, basename(f_name))
  if (file.copy(f_name, f_dest, overwrite = TRUE)) {
    f_dest
  } else {
    stop("Can't copy file to tempdir")
  }
}

Try the rb3 package in your browser

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

rb3 documentation built on April 14, 2023, 5:10 p.m.