playwith (version 0.9-54)

playwith.options: User default settings for playwith

Description

A basic user settings facility, like options and lattice.options.

Usage

playwith.options(...) playwith.getOption(name)

Arguments

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.

Details

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.

See Also

playwith

Examples

Run this code
oopt <- playwith.options()
str(oopt)

playwith.options(time.mode = FALSE)

## list options are merged, not replaced
playwith.getOption("arrow")
playwith.options(arrow = list(type = "closed", length = 0.1))
playwith.getOption("arrow")

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)

Run the code above in your browser using DataLab