scinot: Scientific notation.

scinotR Documentation

Scientific notation.

Description

Format using scientific notation.

Usage

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 1 \times 10^n is simplified to 10^n.

Author(s)

Aaron A. King

See Also

scientific

Examples


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 April 3, 2024, 1:33 a.m.