% Generated by roxygen2: do not edit by hand % Please edit documentation in R/operators.R \name{op-na-default} \alias{op-na-default} \alias{\%|\%} \title{Replace missing values} \usage{ x \%|\% y } \arguments{ \item{x}{The original values.} \item{y}{The replacement values. Must be of length 1 or the same length as \code{x}.} } \description{ \strong{Note}: This operator is now out of scope for rlang. It will be replaced by a vctrs-powered operator (probably in the \href{https://github.com/tidyverse/funs}{funs package}) at which point the rlang version of \verb{\%|\%} will be deprecated. This infix function is similar to \code{\%||\%} but is vectorised and provides a default value for missing elements. It is faster than using \code{\link[base:ifelse]{base::ifelse()}} and does not perform type conversions. } \examples{ c("a", "b", NA, "c") \%|\% "default" c(1L, NA, 3L, NA, NA) \%|\% (6L:10L) } \seealso{ \link{op-null-default} } \keyword{internal}