scinot: Scientific notation.

Description Usage Arguments Author(s) See Also Examples

View source: R/scinot.R

Description

Format using scientific notation.

Usage

1
2
scinot(x, digits = 2, format = c("expression","latex","math"),
       simplify = FALSE)

Arguments

x

Number(s) to format.

digits

Number of significant digits in mantissa.

format

Format specification. type="expression" results in an R expression. type="latex" results in a latex expression. type="math" is like "latex" but wraps the text in "$".

simplify

logical. If simplify=TRUE, then 1x10^n is simplified to 10^n.

Author(s)

Aaron A. King kingaa at umich dot edu

See Also

scientific

Examples

1
2
3
4
5
6
x <- c(0.0309595,8577676.441,10000)
scinot(x[2],4)
scinot(x[1],2,"latex")
sapply(x,scinot,digits=3,format='math')
scinot(x,digits=0,simplify=FALSE)
scinot(x,digits=0,simplify=TRUE)

kingaa/aakmisc documentation built on Dec. 11, 2017, 10 a.m.