Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

comma_signif

Comma and Significance Formatter


Description

By default the numeric vectors are first rounded to three significant figures. Then scales::commas is only applied to values greater than or equal to 1000 to ensure that labels are permitted to have different numbers of decimal places.

Usage

comma_signif(x, digits = 3, ...)

Arguments

x

A numeric vector to format.

digits

A whole number specifying the number of significant figures

...

Additional arguments passed to scales::comma.

Value

A character vector.

Examples

comma_signif(c(0.1, 1, 10, 1000))
scales::comma(c(0.1, 1, 10, 1000))

ssdtools

Species Sensitivity Distributions

v0.3.3
Apache License (== 2.0) | file LICENSE
Authors
Joe Thorley [aut, cre, ctr] (<https://orcid.org/0000-0002-7683-4592>), Carl Schwarz [aut, ctr], Angeline Tillmanns [ctb], Ali Azizishirazi [ctb], Rebecca Fisher [ctb], David Fox [ctb], Kathleen McTavish [ctb], Heather Thompson [ctb], Andy Teucher [ctb], Emilie Doussantousse [ctb], Stephanie Hazlitt [ctb], Nadine Hussein [ctb], Nan-Hung Hsieh [ctb], Sergio Ibarra Espinosa [ctb], Province of British Columbia [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.