scinot: Scientific notation as LaTeX/expression()

Description Usage Arguments Value Author(s) See Also Examples

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), or plots an axis with labels in scientific notation

Usage

1
2
3
scinot(x, format = c("latex", "expression"), delim="$",
pref="", ...)
axis.scinot(side,at)

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)

side

side on which to plot axis

at

list of locations/labels

...

additional arguments to formatC

Value

a character vector (if latex) or expression (if expression); axis.scinot draws an axis on the current plot

Author(s)

Ben Bolker

See Also

formatC, expression, plotmath, axis, axTicks, latexSN in the Hmisc package, eaxis in the sfsmisc package

Examples

1
2
3
4
5
6
7
8
scinot(1e-5)
scinot(1e-5,digits=0)
scinot(1e-5,"expression")
scinot(1e-5,"expression",pref="p=")
set.seed(1001)
plot(1:100,rlnorm(100,0,2),log="y",axes=FALSE)
axis(side=1)
axis.scinot(side=2)  ## fix bug!


Search within the emdbook package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.