Skip to content

Commit 9145728

Browse files
committed
Reexport %||% from base on newer R versions
1 parent 92d764d commit 9145728

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
* Fix for CRAN checks.
44

5+
* `%||%` is now reexported from base on newer R versions. This avoids
6+
conflict messages when attaching or importing rlang.
7+
58

69
# rlang 1.1.2
710

R/operators.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
`%||%` <- function(x, y) {
1414
if (is_null(x)) y else x
1515
}
16+
17+
# Reexport from base on newer versions of R to avoid conflict messages
18+
if (exists("%||%", envir = baseenv())) {
19+
`%||%` <- get("%||%", envir = baseenv())
20+
}
21+
1622
`%|0|%` <- function(x, y) {
1723
if (!length(x)) y else x
1824
}

0 commit comments

Comments
 (0)