R/util.R

Defines functions `%||%` substitute_ vnapply xlerate_file set_names

`%||%` <- function(a, b) {
  if (is.null(a)) b else a
}


substitute_ <- function(expr, env) {
  eval(substitute(substitute(y, env), list(y = expr)))
}


vnapply <- function(X, FUN, ...) {
  vapply(X, FUN, numeric(1), ...)
}


xlerate_file <- function(name) {
  system.file(name, package = "xlerate", mustWork = TRUE)
}


set_names <- function(x, nms) {
  names(x) <- nms
  x
}
HealthEconomicsHackathon/xlerate documentation built on Nov. 8, 2019, 12:33 a.m.