Learn R Programming

swirl (version 2.2.6)

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

Description

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

Usage

expr_creates_var(correctName = NULL)

Arguments

correctName
expected name of the new variable or NULL

Value

  • TRUE or FALSE

Examples

Run this code
# 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')

Run the code above in your browser using DataLab