playwith.options: User default settings for playwith

Description Usage Arguments Details See Also Examples

Description

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

Usage

1
2

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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)

floybix/playwith documentation built on May 16, 2019, 1:25 p.m.