default {hgutils} | R Documentation |
Returns a default value for a scalar, to be used when the input is NA, NULL or has a length of 0.
default(x, default_value)
x |
A value |
default_value |
The replacement value for when x is NA, NULL or has a length of 0. |
The value of x when x is not NA, NULL or has a length of 0, and default_value otherwise.
default(NA, 0)