Learn R Programming

emdbook (version 1.0.8.1)

scinot: Scientific notation as LaTeX/expression()

Description

Takes a number and returns a version formatted in LaTeX (suitable for use with Sexpr() in an Sweave document) or in expression() (suitable for plotting)

Usage

scinot(x, format = c("latex", "expression"), delim="$",
pref="", ...)

Arguments

x
a numeric vector (of length 1)
format
produce LaTeX or expression() format?
delim
delimiter to add at beginning and end (latex only)
pref
text to put before expression (expression only)
...
additional arguments to formatC

Value

  • a character vector (if latex) or expression (if expression)

See Also

formatC, expression, plotmath, latexSN in the Hmisc package

Examples

Run this code
scinot(1e-5)
scinot(1e-5,digits=0)
scinot(1e-5,"expression")
scinot(1e-5,"expression",pref="p=")

Run the code above in your browser using DataLab