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. format="expression" results in an R expression. format="latex" results in a latex expression. format="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

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 Sept. 29, 2018, 9:33 p.m.