R/ResourceFiles.R

Defines functions readCsv getThisPackageName

getThisPackageName <- function() {
  return("Covid19VaccineAesiIncidenceRate")
}

#' @export
readCsv <- function(resourceFile, packageName = getThisPackageName(), col_types = readr::cols()) {
  packageName <- getThisPackageName()
  pathToCsv <- system.file(resourceFile, package = packageName, mustWork = TRUE)
  fileContents <- readr::read_csv(pathToCsv, col_types = col_types, lazy = FALSE)
  return(fileContents)
}
ohdsi-studies/Covid19VaccineAesiIncidenceRate documentation built on Dec. 22, 2021, 4:16 a.m.