Learn R Programming

swirl (version 2.2.9)

any_of_exprs: Test that the user has entered one of several possible expressions.

Description

Returns TRUE if the expression which as user has entered matches any of the expressions given (as characters) in the argument.

Usage

any_of_exprs(...)

Arguments

...
any number of expressions

Value

  • TRUE or FALSE

See Also

Other AnswerTests: AnswerTests; expr_creates_var; expr_identical_to; expr_is_a; expr_uses_func; func_of_newvar_equals; omnitest; val_has_length; val_matches; var_is_a

Examples

Run this code
# Test that a user has entered either cor(x, y) or cor(y,x)
any_of_exprs('cor(x,y)','cor(y,x)')

Run the code above in your browser using DataLab