options(...) .Options
options allows the user to set and examine a variety of global
``options'' which affect the way in which R computes and displays
its results.
Invoking options() with no arguments returns a list with the
current values of the options.
.Options is another way to access this list ``read only''.
Accessing current options, usually will work with .Options$width
(e.g.), rather than options("width") which is a list of
length one.
A list (in any case) with the previous values of the options changed, or all options when no arguments were given.
options() # printing all current options
op <- options(); str(op) # nicer printing
# .Options is the same:
all(sapply(1:length(op), function(i) all(.Options[[i]] == op[[i]])))
options('width')[[1]] == options()$width # the latter needs more memory
options(digits=20)
pi
# set the editor, and save previous value
old.o <- options(editor="nedit")
old.o
options(op) # reset (all) initial options
options('digits')