R/utils.R

Defines functions if_null str_replace

# If a is null, then b
if_null <- function(a, b) {
  if (!is.null(a)) {
    a
  } else {
    b
  }
}

str_replace <- function(x, pattern, replacement) {
  gsub(pattern, replacement, x)
}
hafen/packagedocs documentation built on Oct. 3, 2019, 9:32 p.m.