number {supernova} | R Documentation |
number
vector
Description
This creates a formatted double vector. You can specify the number of digits you want the value to display after the decimal, and the underlying value will not change. Additionally you can explicitly set whether scientific notation should be used and if numbers less than 0 should contain a leading 0.
Usage
number(x = numeric(), digits = 3L, scientific = FALSE, leading_zero = TRUE)
is_number(x)
as_number(x)
Arguments
x |
|
digits |
The number of digits to display after the decimal point. |
scientific |
Whether the number should be represented with scientific notation (e.g. 1e2) |
leading_zero |
Whether a leading zero should be used on numbers less than 0 (e.g. .001) |
Value
An S3 vector of class supernova_number
. It should behave like a double, but be
formatted consistently.
Examples
number(1:5, digits = 3)
[Package supernova version 3.0.0 Index]