[R] Sweave \Sexpr() issue

Martin Maechler maechler at stat.math.ethz.ch
Thu Sep 25 10:13:54 CEST 2003


>>>>> "Jason" == Jason Turner <jasont at indigoindustrial.co.nz>
>>>>>     on 25 Sep 2003 11:39:05 +1200 writes:

    Jason> On Thu, 2003-09-25 at 11:20, Fernando Henrique Ferraz
    Jason> wrote:
    >> Hi, I'm having a little issue with \Sexpr{bla} relating
    >> to the number of digits it is using to print its output.

    Jason> Try \Sexpr{format(bla,digits=3)}

Yes, definitely use  format() { or formatC() }!

format() actually  *does* use  `options(digits)' .
So you could set the option and then call format() several times
without setting digits.  
{ formatC() main purpose has been for text in graphics, and
  hence does not use options(digits),  but by default uses only
  a few digits}

Martin




More information about the R-help mailing list