R/ResourceFiles.R

Defines functions readCsv getThisPackageName

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

#' @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)
  return(fileContents)
}
ohdsi-studies/Covid19VaccineAesiIncidenceCharacterization documentation built on Feb. 20, 2022, 1:57 a.m.