Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

local-options

Quick Option-like Feature


Description

mkoptions is a function that returns a function that behaves like options, with an attached internal/local list of key-value pairs.

Usage

mkoptions(...)

.options(..., .DATA)

Arguments

...

list of keys or key-value pairs. For mkoptions these define inital/default key-value pairs.

.DATA

a list or an environment with an element .options.

Functions

  • .options: is a low-level function that mimics the behaviour of the base function options, given a set of key-value pairs. It is the workhorse function used in mkoptions and package-specific option sets (see setupPackageOptions)

See Also

Examples

f <- mkoptions(a=3, b=list(1,2,3))
str(f())
f('a')
f('b')
str(old <- f(a = 10))
str(f())
f(old)
str(f())

pkgmaker

Development Utilities for R Packages

v0.32.2
GPL (>= 2)
Authors
Renaud Gaujoux [aut, cre]
Initial release
2020-10-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.