MatchListMembers {PCMBase} | R Documentation |
Find the members in a list matching a member expression
Description
Find the members in a list matching a member expression
Usage
MatchListMembers(object, member, enclos = "?", q = "'", ...)
Arguments
object |
a list containing named elements. |
member |
a member expression. Member expressions are character strings denoting named elements in a list object (see examples). |
enclos |
a character string containing the special symbol '?'. This symbol is to be replaced by matching expressions. The result of this substitution can be anything but, usually would be a valid R expression. Default: "?". |
q |
a quote symbol, Default: |
... |
additional arguments passed to |
Value
a named character vector, with names corresponding to the matched
member quoted expressions (using the argument q
as a quote symbol),
and values corresponding to the 'enclos
-ed' expressions after
substituting the '?'.
See Also
Examples
model <- PCMBaseTestObjects$model_MixedGaussian_ab
MatchListMembers(model, "Sigma_x", "diag(model?[,,1L])")
MatchListMembers(model, "S.*_x", "diag(model?[,,1L])")
MatchListMembers(model, "Sigma_x", "model?[,,1L][upper.tri(model?[,,1L])]")
MatchListMembers(model, "a$Sigma_x", "model?[,,1L][upper.tri(model?[,,1L])]")