Rev 9463 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{options}\alias{options}\alias{.Options}\alias{getOption}\title{Options Settings}\usage{options(\dots)getOption(x).Options}\arguments{\item{\dots}{any options can be defined, using \code{name = value}.However, only the ones below are used in ``base \R''.Further, \code{options('name') == options()['name']}, see the example.}\item{prompt}{a string, used for \R's prompt; should usually end in ablank (\code{" "}).}\item{continue}{a string setting the prompt used for lines which continueover one line.}\item{width}{controls the number of characters on a line. You maywant to change this if you re-size the window that \R is running in.}\item{digits}{controls the number of digits to print when printingnumeric values. It is a suggestion only.}\item{editor}{sets the default text editor, e.g., for\code{\link{edit}}. Set from the environment variable \code{VISUAL}on UNIX.}\item{pager}{the (stand-alone) program used for displaying ASCII files on\R's console.#ifdef unixDefaults to \file{\$R\_HOME/bin/pager}.#endif#ifdef windowsDefaults to \code{"internal"}, which uses a pager similar to the GUIconsole. Another possibility is \code{"console"} to use the console itself.#endif}\item{browser}{default HTML browser used by \code{\link{help.start}()}on UNIX.}\item{mailer}{default mailer used by \code{\link{bug.report}()}. canbe \code{"none"}.}\item{contrasts}{the default \code{\link{contrasts}} used in modelfitting such as with \code{\link{aov}} or \code{\link{lm}}. Acharacter vector of length two, the first giving the function to beused with unordered factors and the second the function to be usedwith ordered factors.}\item{expressions}{sets a limit on the number of nested expressions thatwill be evaluated. This is especially important on the Macintoshsince stack overflow is likely if this is set too high.}\item{keep.source}{When \code{TRUE}, the source code for functions(newly defined or loaded) is stored in their \code{"source"}attribute (see \code{\link{attr}}) allowing comments to be kept inthe right places.The default is \code{\link{interactive}()}, i.e., \code{TRUE} forinteractive use.}\item{keep.source.pkgs}{As for \code{keep.source}, for functions inpackages loaded by \code{\link{library}} or \code{\link{require}}.Defaults to \code{FALSE} unless the environment variable\code{R_KEEP_PKG_SOURCE} is set to \code{yes}.}\item{na.action}{the name of a function for treating missing values(\code{\link{NA}}'s) for certain situations.}\item{papersize}{the default paper format used by \code{\link{postscript}};set by environment variable \code{R_PAPERSIZE} when \R is startedand defaulting to \code{"a4"} if that is unset or invalid.}\item{printcmd}{the command used by \code{\link{postscript}} forprinting; set by environment variable \code{R_PRINTCMD} when \R isstarted. This should be a command that expects either input to be pipedto \file{stdin} or to be given a single filename argument.}#ifdef unix\item{latexcmd, dvipscmd}{character strings giving commands to be usedin off-line printing of help pages.}#endif\item{show.signif.stars, show.coef.Pvalues}{logical, affecting P valueprinting, see \code{\link{print.coefmat}}.}\item{ts.eps}{the relative tolerance for certain time series(\code{\link{ts}}) computations.}\item{error}{an expression governing the handling of non-catastrophicerrors such as those generated by \code{\link{stop}} as well as bysignals and internally detected errors. The default expression is\code{NULL}: see \code{\link{stop}} for the behaviour in that case.The function \code{\link{dump.frames}} provides one alternative thatallows post-mortem debugging.}\item{show.error.messages}{a logical. Should error messages beprinted? Intended for use with \code{\link{try}} or auser-installed error handler.}\item{warn}{sets the handling of warning messages. If \code{warn}is negative all warnings are ignored. If \code{warn} is zero(the default) warnings are stored until the top--level functionreturns. If fewer than 10 warnings were signalled they will be printedotherwise a message saying how many (max 50) were signalled. Atop--level variable called \code{last.warning} is created and can beviewed through the function \code{\link{warnings}}. If \code{warn} isone, warnings are printed as they occur. If \code{warn} is two orlarger all warnings are turned into errors.}\item{echo}{logical. Only used in non-interactive mode, when itcontrols whether input is echoed. Command-line options\code{--quiet} and \code{--slave} set this initially to \code{FALSE}.}\item{verbose}{logical. Should \R report extra information onprogress? Set to \code{TRUE} by the command-line option\code{--verbose}.}\item{device}{a character string giving the default device for thatsession. This defaults to the normal screen device (e.g. \code{x11},\code{windows} or \code{gtk}) for an interactive session, and\code{postscript} in batch use or if a screen is not available.}#ifdef unix\item{X11colortype}{The default colour type for \code{\link{X11}} devices.}#endif\item{CRAN}{The URL of the preferred CRAN node for use by\code{\link{update.packages}}. Defaults to\url{http://cran.r-project.org}.}\item{unzip}{the command used unzipping help files.#ifdef windowsDefaults to "internal" when the internal unzip DLL is used.#endif}\item{de.cellwidth}{integer: the cell widths (number of characters)to be used in the data editor \code{\link{dataentry}}. If this isunset, 0, negative or \code{NA}, variable cell widths are used.}\item{x}{a character string holding one of the above option names.}}\description{\code{options} allows the user to set and examine a variety of global``options'' which affect the way in which \R computes and displaysits results.}\details{Invoking \code{options()} with no arguments returns a list with thecurrent values of the options. To access the value of a singleoption, one should use \code{getOption("width")}, e.g., rather than\code{options("width")} which is a \emph{list} of length one.The default settings of some of these options are\tabular{llll}{\code{prompt} \tab \code{"> "} \tab\code{continue} \tab \code{"+ "}\cr\code{width} \tab \code{80} \tab\code{digits} \tab \code{7}\cr\code{expressions} \tab \code{500} \tab\code{keep.source} \tab \code{TRUE}\cr\code{show.signif.stars} \tab \code{TRUE} \tab\code{show.coef.Pvalues} \tab \code{TRUE}\cr\code{na.action} \tab \code{na.omit} \tab\code{ts.eps} \tab \code{1e-5}\cr\code{error} \tab \code{NULL} \tab\code{warn} \tab \code{0}\cr\code{echo} \tab \code{TRUE} \tab\code{verbose} \tab \code{FALSE}}Others are set from environment variables or are platform-dependent.}\value{A list (in any case) with the previous values of the options changed,or all options when no arguments were given.}\examples{options() # printing all current optionsop <- 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 memoryoptions(digits=20)pi# set the editor, and save previous valueold.o <- options(editor="nedit")old.ooptions(op) # reset (all) initial optionsoptions('digits')\dontrun{## set contrast handling to be like Soptions(contrasts=c("contr.helmert", "contr.poly"))}\dontrun{## on error, terminate the R session with error status 66options(error=quote(q("no", status=66, runLast=FALSE)))stop("test it")}\dontrun{## set an error action for debugging: see ?debugger.options(error=quote(dump.frames()))## A possible setting for non-interactive sessionsoptions(error=quote({dump.frames(to.file=TRUE); q()}))}}\keyword{environment}\keyword{error}\keyword{print}