The options mechanism in R
Customization in R.
Basics
Several features benefit from being customizable — either because of personal taste or specifics of the environment.
The way R implements this flexibility is through the options
function. This both sets and reports options. For example, we can see the names of the options that are set by default:
> names(options()) [1] "add.smooth" "browser" [3] "browserNLdisabled" "check.bounds" [5] "continue" "contrasts" [7] "defaultPackages" "demo.ask" [9] "device" "device.ask.default" [11] "digits" "echo" [13] "editor" "encoding" [15] "example.ask" "expressions" [17] "help.search.types" "help.try.all.packages" [19] "help_type" "HTTPUserAgent" [21] "internet.info" "keep.source" [23] "keep.source.pkgs" "locatorBell" [25] "mailer" "max.print" [27] "menu.graphics" "na.action" [29] "nwarnings" "OutDec" [31] "pager" "papersize" [33] "pdfviewer" "pkgType" [35] "prompt" "repos" [37] "scipen" "show.coef.Pvalues" [39] "show.error.messages" "show.signif.stars" [41] "str" "str.dendrogram.last" [43] "stringsAsFactors" "timeout" [45] "ts.eps" "ts.S.compat" [47] "unzip" "useFancyQuotes" [49] "verbose" "warn" [51] "warning.length" "width" [53] "windowsTimeouts"
options
returns a list. Most of the options are not especially interesting — we’ll highlight a few of the most useful. Read more →