R/utils.R

Defines functions read_pkg_file `%||%`

# use y if x is.null
`%||%` <- function(x, y) if (is.null(x)) y else x

read_pkg_file <- function(..., collapse = "\n", sep = "") {
  paste(
    readLines(system.file(..., package = "tweetrmd", mustWork = TRUE)),
    sep = "",
    collapse = collapse
  )
}
gadenbuie/tweetrmd documentation built on Jan. 1, 2020, 12:55 a.m.