signif2 | R Documentation |
Convert numeric vector to character vector with specified number of significant digits, retaining trailing zeros
signif2(x, sigfigs = 2, format = "g")
x |
Numeric vector |
sigfigs |
Number of significant digits, Default: 2 |
format |
'g': use scientific notation when more compact; 'fg': numbers in xx.yy format, Default: 'g' |
Character and logical vectors are returned as is.
Character vector of numbers formatted to the specified number of sigfigs
## Not run:
if(interactive()){
signif2(rnorm(10))
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.