R/zzz.R

Defines functions .onLoad safe_readCSV safe_readXL

Documented in safe_readXL

#' Safe read an excel file
#' 
#' to construct it I need a "dummy"" output first and the
#' construct it in the .onLoad
#' see https://purrr.tidyverse.org/reference/faq-adverbs-export.html
#' We do it this way so that the safe_readXL is created on package load
#' to  get the latest update of purrr
#' @param ... temporary
safe_readXL <- function(...) "dummy"

safe_readCSV <- function(...) "dummy"

.onLoad <- function(libname, pkgname){

  safe_readXL <<- purrr::safely(readxl::read_excel)
  
  safe_readCSV <<- purrr::safely(readr::read_csv)
}
lefkiospaikousis/CSIemail documentation built on June 15, 2022, 10:39 p.m.