R/utils-ndr-null.R

Defines functions `%||%`

#' Borrowed NULL
#'
#' @param x value set to a default value of null
#' @param y value to be used with x is null
#'
#' @name ndr-null-op
#' @export
#' @return No return value, called for side effects
#' @keywords internal
`%||%` <- function(x, y) {
  if (rlang::is_null(x)) {
    y
  } else {
    x
  }
}

Try the tidyndr package in your browser

Any scripts or data that you put into this service are public.

tidyndr documentation built on April 8, 2022, 9:06 a.m.