Last chance! 50% off unlimited learning
Sale ends in
NA
Set a default value depending on if an object is NA
x %NA% yx %na% y
x %!NA% y
x %!na% y
For %NA%
: y
if x
is NA
;
otherwise x
For %!NA%
: y
if x
is not
NA
; otherwise x
An object to test
A default value
1 %NA% 2
NA %NA% 2
1 %!NA% 2
NA %!NA% 2
Run the code above in your browser using DataLab