is_robust_match {swirl} | R Documentation |
Recursively expand both the correct expression and the user's expression and test for a match. CAUTION: May raise errors, as in rmatch_calls.
Description
Recursively expand both the correct expression and the user's expression and test for a match. CAUTION: May raise errors, as in rmatch_calls.
Usage
is_robust_match(expr1, expr2, eval_for_class, eval_env = NULL)
Arguments
expr1 |
expression |
expr2 |
expression |
eval_for_class |
TRUE or FALSE. If TRUE, evaluate the first argument of an S3 method to determine its class. Default=FALSE. |
eval_env |
parent environment for evaluations to determine class. Ignored if eval_for_class=FALSE |
Value
TRUE or FALSE according to whether expanded expressions match.
Examples
## Not run:
expr1 <- quote(print(paste("my_name_is", "mud")))
expr2 <- quote(print(paste("my_name_is", "mud", sep=" ")))
err <- try(ans <- is_robust_match(expr1, expr2, eval_for_class=TRUE), silent=TRUE)
if(is(ans, "try-error")){
ans <- isTRUE(all.equal())
}
## End(Not run)
[Package swirl version 2.4.5 Index]