R - %||% pipe operator

58 Views Asked by At

I'm trying to reuse snippets of code from the r-lib repository. I can't find where this particular pipe operator is defined:

getOption("usethis.description") %||% list()

Could anyone direct me to the source code for this pipe operator?

1

There are 1 best solutions below

0
Dylan Russell On

Answer credit to @akrun.

%||% is defined in rlang:

`%||%` <- function (x, y) 
{
    if (is_null(x)) 
        y
    else x
}