[Rd] bug in options() - help page (PR#1323)

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Sat, 23 Feb 2002 19:25:00 +0100 (MET)

Much of this is not a bug.  The situation is complex.

The options list is dynamic: users can add new options at any time.
Options need not be set, and which options are set depends on
the platform.  Many options if unset have an internal default: this is a
protection against a damaged set of options, in particular a broken system
Rprofile file.

It is an incorrect assumption that setting the previous options returned
does re-set the options: it only resets those that were previously set,
not those set since.

In many cases setting an option to NULL will unset it.

There is at least one bug: download.info should not be set, it having been
changed to internet.info (which has an internal default).

On Sat, 23 Feb 2002 o.christensen@lancaster.ac.uk wrote:

> Dear R-developers
> There is a discrepancy between the variables found by typing
> names(options()) and the variables described on the help page for the
> function ``options''.
> The following variables are in names(options()) but not described on the
> help page :
> "error.messages"
> "repositories"
> "show.coef.Pvalues"
> "help.try.all.packages"
> "download.info"
> "dvipscmd"

Some options are documented where they are used: numbers 2 and 4 are, I
know.  I believe `error.messages' is obselete.

> Since options() is part of ``base R'' and the homepage claims that the
> options described there are the only options used by ``base R'', this
> may be considered as a
> bug.

That claim is a bug, not least because ``base R'' is undefined!

> The following variables are described on the help
> page, but are not in names(options()):
> error
> show.error.messages
> download.file.method
> de.cellwidth
> internet.info

Right. They can be set if needed, but have internal defaults.

> I had a problem with the option ``show.error.messages'' which may be
> related to this option not being in names(options()) (I do not claim to
> understand how options() really work).
> Reporting and checking a problem with ``show.error.messages'' is
> actually confusing, since this option changes the printed output from
> errors. Here is the problem and my comments on the output (consider
> starting a fresh R session).
> stop("test - err. mess. printed ")
> ## prints error mesage, unless ``show.error.messages=FALSE''
> op <- options()
> options(show.error.messages=FALSE)
> stop("test - err. mess. printed ")
> ## as expected, nothing is printed
> options(op)
> stop("test - err. mess. printed ")
> ## Reseting the options, we expect to see the print. Nothing is printed

That does not `reset the options', nor is that what the help page example
says it does (note the word `initial').  The same thing happens with

I'll add an explicit default for that one.

Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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