grapes-or-grapes: Replace NA values in LHS with RHS

%|%R Documentation

Replace NA values in LHS with RHS

Description

Does not strictly enforce class typing like op-na-default

Usage

lhs %|% rhs

Arguments

lhs

vctr of values possibly containing NA on which replacement will be performed

rhs

vctr of values length 1 or the same length with which to replace NA

Value

vctr with class according to R's coercion rules.

See Also

Other infixes: %allin%(), %nin%(), %|0|%(), %|legit|%(), %|try|%(), %|zchar|%()

Examples

c(4, NA, 4) %|% 3
c(4, NA, 4) %|% 3L
class(c(4, NA, 4, NA) %|% 3L)
cclass((NA, NA, NA, NA) %|% 3L)
c(4, NA, 4, NA) %|% c(2,2,2,3)

yogat3ch/UU documentation built on May 31, 2024, 10:14 p.m.