
Is the expression actually a flag that can be used in the rxUdfUi functions?
Source:R/rudfui.R
rxUdfUiFlag.RdThis is useful when writing replacement UI functions
Usage
rxUdfUiFlag(expr, arg = "arg", funName = "fun", env = baseenv())Arguments
- expr
expression to evaluate
- arg
argument name for error messages for the argument name in the
rxUdfUiextension when the expression is not logical- funName
function name for the error message for the argument name in the
rxUdfUiextension when the expression is not logical.- env
the environment in which to evaluate the expression (in case it is numeric)
Value
logical value of the expression if it can be evaluated to a
scalar TRUE/FALSE value, otherwise an error is thrown.
See also
Other User functions:
linMod(),
mix(),
rxD(),
rxFun(),
rxIntToBase(),
rxIntToLetter(),
rxUdfUiControl(),
rxUdfUiData(),
rxUdfUiEst(),
rxUdfUiExpr(),
rxUdfUiIniDf(),
rxUdfUiIniLhs(),
rxUdfUiIsValue(),
rxUdfUiLhs.dist(),
rxUdfUiMv(),
rxUdfUiNum(),
rxUdfUiParsing()
Examples
# in a rxUdfUi handler for dnorm(x, log=...), check the parsed `log` argument
args <- as.list(quote(dnorm(x, log = TRUE)))[-1]
rxUdfUiFlag(args$log, arg = "log", funName = "dnorm")
#> [1] TRUE
rxUdfUiFlag(quote(0), arg = "log", funName = "dnorm")
#> [1] FALSE
try(rxUdfUiFlag(quote(y), arg = "log", funName = "dnorm"))
#> Error : 'dnorm' requires 'log' to be a scalar TRUE/FALSE value in rxode2 model syntax