| playwith.options {playwith} | R Documentation |
A basic user settings facility, like options and
lattice.options.
playwith.options(...) playwith.getOption(name)
name |
character giving the name of a setting. |
... |
new options can be defined, or existing ones modified, using one or more arguments of the form 'name = value' or by passing a list of such tagged values. Existing values can be retrieved by supplying the names (as character strings) of the components as unnamed arguments. |
These functions are direct copies of the lattice equivalents:
see lattice.options.
The available options can be seen with str(playwith.options()).
Many of these simply provide defaults for corresponding arguments
to the playwith function.
str(playwith.options())
## list options are merged, not replaced
playwith.getOption("arrow")
playwith.options(arrow = list(type = "closed", length = 0.1))
playwith.getOption("arrow")
oopt <- playwith.options()
playwith.options(save.as.format = "png")
playwith.options(toolbar.style = "icons")
playwith.options(deparse.options =
c("keepInteger", "showAttributes", "keepNA"))
## make a new "style shortcut" (an arbitrary expression)
## to add a standard sub-title to the plot:
doMySub <- quote({
txt <- ginput("Enter subtitle text:",
text = paste(Sys.time(), Sys.info()["login"],
R.version.string, sep = ", "))
if (!is.na(txt))
callArg(playState, "sub") <- if (nchar(txt) > 0) txt
})
playwith.options(styleShortcuts = list("mySub" = doMySub))
## try it:
if (interactive())
playwith(plot(1:10))
## reset
playwith.options(oopt)