3.2 Name Check (G)

Purpose: Checks whether the student’s variable has the correct name.

Motivation: All questions require the student to give their variable a specific name. Without a Name Check, the autograder can’t match and compare the student’s answer to the answer key – and other Checks that rely on a correctly named student variable, such as the Column Name Check, may error out as a result.

#Name Check Example

if(is.error(variable_name)){ 
  test.results[2, 4] <- "`variable_name` is not found. Please make sure the variable is named correctly. (Any additional feedback as needed.)"
}

Technicals

Always include the Name Check.

If there is no Prerequisite Check, place this Check first (the if statement); otherwise, it should follow immediately after (the first else if statement).

Note:

The is.error() function comes from the berryFunctions package (Boessenkool 2024). For the ECON 145 autograder, this library should already be loaded in from the file helper_functions/packages.R.

References

Boessenkool, Berry. 2024. berryFunctions: Function Collection Related to Plotting and Hydrology. https://github.com/brry/berryFunctions.