scinot {emdbook}R Documentation

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)

Author(s)

Ben Bolker

See Also

formatC, expression, plotmath, latexSN in Hmisc package

Examples

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

[Package emdbook version 1.0.6 Index]