num_vals_close: Are submission and solution numeric values close

View source: R/utils.R

num_vals_closeR Documentation

Are submission and solution numeric values close

Description

Test whether numeric values in the submission are close to corresponding values in the solution environment.

Usage

num_vals_close(
  subvar,
  sol_env,
  solvar = subvar,
  ignore.case = FALSE,
  tolerance = 0.002,
  add = TRUE,
  inherits = FALSE
)

Arguments

subvar

Name of the submission variable whose value you want to test

sol_env

solution environment

solvar

Name of the solution variable to test against

ignore.case

whether to accept same variable name but different capitalization

tolerance

how close the values have to be

add

whether to add feedback

Value

logical; TRUE if abs(x - get(x, sol_env)) < tolerance


dalejbarr/assessr documentation built on Jan. 25, 2024, 10:47 p.m.