toLatex.numeric: LaTeX or Sweave friendly Formatting of Numbers
Description
Formats real numbers, possibly in scientific notation, with a given
number of digits after the decimal point. Output can be used in LaTeX
math mode, e.g., for printing numbers in a table, where each number
has to be printed with the same number of digits after the decimal
point, even if the last digits are zeros.
Usage
# S3 method for numeric
toLatex(object, digits = format.info(object)[2],
scientific = format.info(object)[3] > 0, times = "\\cdot", ...)
Value
a character vector of the same length as object,
containing the formatted numbers.
Arguments
object
a numeric vector.
digits
number of digits after the decimal point (for the
mantissa if scientific). The default behaves the same as R's
format().
scientific
logical indicating if scientific notation a *
10^k should be used. The default behaves the same as R's
format().
times
character string indicating the LaTeX symbol to be used for
the ‘times’ sign.