R/utils.r

find_file <- function(template, file) {
  template <- system.file("rmarkdown", "templates", template, file,
                          package = "ifar.reports")
  if (template == "") {
    stop("Couldn't find template file ", template, "/", file, call. = FALSE)
  }

  template
}

find_resource <- function(template, file) {
  find_file(template, file.path("resources", file))
}
IFARbiostats/ifar.reports documentation built on May 8, 2019, 10:54 a.m.