expr_creates_var: Test that a new variable has been created.

Description Usage Arguments Value See Also Examples

View source: R/answerTests2.R

Description

Tests if the e$expr creates one new variable (of correct name if given.) If so, returns TRUE.

Usage

1
expr_creates_var(correctName = NULL)

Arguments

correctName

expected name of the new variable or NULL

Value

TRUE or FALSE

See Also

Other AnswerTests: AnswerTests, any_of_exprs(), calculates_same_value(), expr_identical_to(), expr_is_a(), expr_uses_func(), func_of_newvar_equals(), omnitest(), val_has_length(), val_matches(), var_is_a()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# Test if the user has entered an expression which creates
# a new variable of any name.
expr_creates_var()
#
# Test if the user has entered an expression which creates
# a variable named 'myNum'
#
expr_creates_var('myNum')

## End(Not run)

swirl documentation built on Jan. 16, 2020, 5:03 p.m.