From Martin Maechler <maechler@stat.math.ethz.ch>  Mon Aug  4 17:15:49 1997
From: Martin Maechler <maechler@stat.math.ethz.ch> (Martin Maechler)
Date: Mon, 4 Aug 1997 18:15:49 +0200
Subject: R-alpha: .Options$digits  do not (always) work.
Message-ID: <199708041615.SAA28741@sophie.ethz.ch>

I am sorry that this IS an old topic.
Yet another task
I think the bug is somewhere in hidden  in  src/main/options.c ..

##-- The following does not work as it should in  R (0.50-a1, but I think
							also earlier)

tst <- function(x=pi, dig =3) {.Options$digits <- as.integer(dig); print(x);x}
tst()
tst(dig = 12)


##-- This should do the same; it works as expected in R & S :

tst2 <- function(x=pi, dig =3) {
  oo <- options(digits=dig); on.exit(oo); print(x);x}
tst2()
tst2(dig = 12)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: .Options$digits do not (always) work.
Martin Maechler