op-na-default

0th

Percentile

Replace missing values.

This infix function is similar to %||% but is vectorised and provides a default value for missing elements. It is faster than using ifelse() and does not perform type conversions.

Usage
x %|% y
Arguments
x, y
y for elements of x that are NA; otherwise, x.
See Also

op-null-default

Aliases
  • op-na-default
  • %|%
Examples
c("a", "b", NA, "c") %|% "default"
Documentation reproduced from package rlang, version 0.0.0.9000, License: GPL-3

Community examples

Looks like there are no examples yet.