set-if-na | R Documentation |
NA
Set a default value depending on if an object is NA
x %NA% y
x %na% y
x %!NA% y
x %!na% y
x |
An object to test |
y |
A default value |
For %NA%
: y
if x
is NA
;
otherwise x
For %!NA%
: y
if x
is not
NA
; otherwise x
# Set if NA
1 %NA% 2
NA %NA% 2
# Set if *not* NA
1 %!NA% 2
NA %!NA% 2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.