Skip to content

Commit e0bc60f

Browse files
committed
Export %||% pipe
1 parent a6c41c9 commit e0bc60f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

R/utils-pipe.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ if (getRversion() >= "2.15.1") {
1818
#' @return The result of calling `rhs(lhs)`.
1919
NULL
2020

21+
#' Null-coalescing operator
22+
#'
23+
#' See \code{rlang::\link[rlang:op-null-default]{\%||\%}} for details.
24+
#'
25+
#' @name %||%
26+
#' @rdname null_default
27+
#' @keywords internal
28+
#' @export
29+
#' @importFrom rlang %||%
30+
#' @usage lhs \%||\% rhs
31+
#' @param lhs Any R object, typically checked for `NULL`.
32+
#' @param rhs A default value to return if `lhs` is `NULL`.
33+
#' @return `lhs` if it is not `NULL`, otherwise `rhs`.
34+
NULL
35+
2136

2237
#' @noRd
2338
.onAttach <- function(...) {

0 commit comments

Comments
 (0)