options(...)
While any option names can be used, the following have special meaning:
OPTIONS CONCERNING THE SESSION ENVIRONMENT
OPTIONS CONCERNING ERROR HANDLING
OPTIONS CONCERNING MEMORY USAGE
The default values for these options are as follows: audit.size=5e5 check=FALSE compact=1e5 continue="+ " contrasts=c("contr.helmert", "contr.poly") digits=7 echo=FALSE editor="vi" error=dump.calls expressions=256 free=TRUE gui=NULL interrupt=NULL pager="less" keep="function" length=48 memory=2147483647 object.size=5e6 prompt="> " reference=TRUE scrap=500 show=TRUE ts.eps=1e-5 warn=0 width=80
If a character vector is given as the only argument, a list of the current values of the options named by the character vector is returned. Options that have never been set have the value NULL.
If an object of mode list is given as the only argument, its components will be copied in as the values for options with the corresponding names (the side effect) and a list of the previous values of those options are returned. Generally, the list given as an argument is the value of a previous call to options.
Otherwise, arguments must be given in the name=value form, and a list is returned of the previous values of the options with these names.
If options is called with either a list as the single argument, or with one or more arguments in the name=value form, then options specified by the names in the argument(s) are changed or created.
In the last example an object called .Options is produced in the frame of the function. Functions that use an option get the value of the option from the first .Options object that is found.
There may be special options that do not exist by default but that are recognized by various functions when set. For example, options(core.dump=T) will cause S-PLUS to create a file named core if S-PLUS should terminate abnormally.
amp;# sets the maximum length of line to 50 characters and returns a length 1 list options(width = 50) options(digits = 3, check = T) options(c("compact","scrap")) # view two particular options temp <- options(prompt = "Say something! ", continue="\t") amp;# some computations, then options(temp) # restore prompt and continue silent.eval <- function(expr) { old <- options(warn = -1) on.exit(options(old)) expr } silent.log <- function(x) { .Options$warn <- -1 #turn off NA warnings log(x) }