[R] Problem with large/small numbers in knitr

xiaodao yanghaowang at utk.edu
Wed Dec 26 23:28:25 CET 2012


I have problems with very large numbers using knitr. In the following, my a
and b are extremely small and ssrr and ssru are extremely large. Knitr
delivers error messages. Scaling ssrr and ssru by 1000 resolved the problem:
ssrr <-ssrr/1000 ;  ssru<-ssru/1000
Any clue as to how I might resolve the problem?
BTW, the same program does run in another computer. I am wondering whether
my installation of Scientific Work place interferes, and if so, what else I
might do to avoid the problem.

\documentclass{article}
\begin{document}

<<setup, echo=FALSE, cache=FALSE>>=
## numbers >= 10^5 will be denoted in scientific notation,
## and rounded to 2 digits
options(scipen = 1, digits = 2)

<<>>=
a<-1e-13
b<-2.5e-10
ssrr<-123456.12
ssru<-123400.00
@

$
c=\Sexpr{a}/\Sexpr{b} % either this formula or the following formula will
has error message "missing $" after click "complie" in Rstudio.
f=\Sexpr{ssrr-ssru}/\Sexpr{ssru}
$

\end{document}



--
View this message in context: http://r.789695.n4.nabble.com/Problem-with-large-small-numbers-in-knitr-tp4653986.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list