R/utils-pipe.R

Defines functions `%||%`

#' Pipe operator
#'
#' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details.
#'
#' @name %>%
#' @rdname pipe
#' @keywords internal
#' @export
#' @importFrom magrittr %>%
#' @usage lhs \%>\% rhs
NULL

`%||%` <- function(x, y) {
  ifelse(is.null(x), y, x)
}
xmarquez/hathiTools documentation built on June 2, 2025, 5:12 a.m.