Require an argument to match the loadflex conventions for that argument name
Source:R/match.arg.loadflex.R
match.arg.loadflex.RdThis function is modeled on match.arg, but it is designed to
facilitate consistency in how argument names are used within the
loadflex package.
Value
The argument after matching to the allowed options for that argument
name. This may differ from the original value of arg if arg
is a truncated version of one of the character options for the argument
(identified using pmatch, as in match.arg.
Details
The key differences between this function and match.arg are that this
function (1) decides what the available options are without reference to the
defaults defined in the calling function, and (2) permits atomic but
non-character choices.
Examples
# match.arg.loadflex knows about some variables by their names alone
flux.or.conc="conc"; flux.or.conc <- loadflex:::match.arg.loadflex(flux.or.conc)
attach.units=TRUE; attach.units <- loadflex:::match.arg.loadflex(attach.units)
# you can also pass in custom choices. as always, partial matching is available
ci.distrib="log"; ci.distrib <- loadflex:::match.arg.loadflex(ci.distrib, c("lognormal","normal"))