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