tex.catwitherror | R Documentation |
A number with error is converted to a string in tex-ready format like xx(yy) thereby automatically determining the digit at which the error applies.
tex.catwitherror(x, dx, digits = 1, with.dollar = TRUE, with.cdot = TRUE, ...)
x |
either a single numeric value, or a numeric vector, where the first element is the value and the second is its error |
dx |
the error. If supplied, it will be printed as the error and the
value is the first element of |
digits |
number of error digits |
with.dollar |
include the tex dollar in the return string or not |
with.cdot |
replace the "e" in scientific notation by tex-style "cdot" or not |
... |
arguments to be passed to |
It is strongly recommended to install the errors
-package. Otherwise
the formatting options are significantly reduced.
The value of the first element of x
is properly rounded to its
significant digits determined by the values of dx
or the second
element of x
(see above) and digits
. Then a tex-ready string
is returned.
writes a string to standard output
Carsten Urbach, curbach@gmx.de and Johann Ostmeyer
tex.catwitherror(x=0.375567, dx=0.001) tex.catwitherror(x=c(0.375567, 0.001)) ## it can be used with apply x = array(c(0.1187, 0.291, 0.388, 0.011, 0.037, 0.021), dim=c(3,2)) apply(x, 1, tex.catwitherror, digits=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.