spround | R Documentation |
Round and specify knitted decimal places all in one step.
spround(x, digits = 2, leading0 = TRUE, less_than = FALSE)
x |
a numeric/character scalar or vector. |
digits |
a numeric scalar indicating the number of decimal places to round to. |
leading0 |
a logical scalar indicating whether leading zeros should be included. |
less_than |
a logical scalar indicating whether rounded values equal to zero should be represented as less than a certain value (e.g., 0.000 becomes < .001). |
spround(x = c(0.1078, 9.9930, 42.4242), digits = 2, leading0 = TRUE)
spround(x = c(0.1078, 9.9930, 42.4242), digits = 2, leading0 = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.