expand_wildcard {CausalQueries} | R Documentation |
Expand statement containing wildcard
expand_wildcard(to_expand, join_by = "|", verbose = TRUE)
to_expand |
A character vector of length 1L. |
join_by |
A logical operator. Used to connect causal statements: AND ('&') or OR ('|'). Defaults to '|'. |
verbose |
Logical. Whether to print expanded query on the console. |
A character string with the expanded expression. Wildcard '.' is replaced by 0 and 1.
# Position of parentheses matters for type of expansion # In the "global expansion" versions of the entire statement are joined expand_wildcard('(Y[X=1, M=.] > Y[X=1, M=.])') # In the "local expansion" versions of indicated parts are joined expand_wildcard('(Y[X=1, M=.]) > (Y[X=1, M=.])') # If parentheses are missing global expansion used. expand_wildcard('Y[X=1, M=.] > Y[X=1, M=.]') # Expressions not requiring expansion are allowed expand_wildcard('(Y[X=1])')