This infix function is similar to %||% but is vectorised
and provides a default value for missing elements. It is faster
than using base::ifelse() and does not perform type conversions.
x %|% y
| x | The original values. |
|---|---|
| y | The replacement values. Must be of length 1 or the same length as |
#> [1] "a" "b" "default" "c"#> [1] 1 7 3 9 10