[R] R] Sweave scientific real display format (e.g. 5e-12)

Ken Knoblauch knoblauch at lyon.inserm.fr
Fri Mar 10 13:21:34 CET 2006


How about some variation on the following:

x <- 5e-12
xc <- as.character(x)
xss<-strsplit(xc, "")
paste("$",xss[1],"\cdot ^{",xss[3],xss[4], xss[5],"}$", sep = "")
[1] "$5cdot ^{-12}$"

untried, of course, but maybe you could squeeze something out of it.

*********************************
Dear All,

I couldn't figure and couldn't google out how to make construct a pair of
\Sexpr s or a LaTeX macro that would include
      5\cdot 10^{-12}
into the LaTeX output istead of
      5e-12 .

Any ideas?

Thank you

Gábor


-- 
Ken Knoblauch
Inserm U371
Cerveau et Vision
Dept. of Cognitive Neuroscience
18 avenue du Doyen Lépine
69500 Bron
France
tel: +33 (0)4 72 91 34 77
fax: +33 (0)4 72 91 34 61
portable: +33 (0)6 84 10 64 10
http://www.lyon.inserm.fr/371/




More information about the R-help mailing list