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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/options.R
\name{mkoptions}
\alias{mkoptions}
\alias{.options}
\title{Quick Option-like Feature}
\usage{
mkoptions(...)
.options(..., .DATA)
}
\arguments{
\item{...}{list of keys or key-value pairs.
For \code{mkoptions} these define inital/default key-value pairs.}
\item{.DATA}{a list or an environment with an element \code{.options}.}
}
\value{
\code{mkoptions} returns a function.
}
\description{
\code{mkoptions} is a function that returns a function that
behaves like \code{\link[base]{options}}, with an attached
internal/local list of key-value pairs.
}
\section{Functions}{
\itemize{
\item \code{.options()}: is a low-level function that mimics the behaviour
of the base function \code{\link[base]{options}}, given a set
of key-value pairs.
It is the workhorse function used in \code{mkoptions} and package-specific
option sets (see \code{\link{setupPackageOptions}})
}}
\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())
}
\seealso{
\code{\link{setupPackageOptions}}
}
|