| .scalar1 | R Documentation |
Helper to coerce an object to numeric and return a single scalar if possible. If coercion fails, the result is non-finite, or the length is not exactly 1, a default value is returned.
.scalar1(x, default = NA_real_)
x |
Object to be coerced to numeric. |
default |
Numeric scalar returned when a valid scalar cannot
be extracted (default is |
A numeric scalar or default if extraction fails.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.