defaultIfNA | R Documentation |
Return the given object or a default value if the object is NA
defaultIfNA(x, default, count = FALSE)
x |
vector possibly containing NA values |
default |
default value that is returned if |
count |
if |
x
if x
is not NA and default
otherwise
defaultIfNULL, defaultIfZero
defaultIfNA(NA, "default") # returns the default value
defaultIfNA("actual", "default") # returns the "actual" value
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.