Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is_robust_match

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)

swirl

Learn R, in R

v2.4.5
MIT + file LICENSE
Authors
Sean Kross [aut, cre], Nick Carchedi [aut], Bill Bauer [aut], Gina Grdina [aut], Filip Schouwenaars [ctb], Wush Wu [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.