pre_check: Pre-check code

Description Usage Arguments Value Examples

Description

Checks first whether the code parses. If so, funs the code looking for errors. If any errors are found, a diagnostic message is returned.

Usage

1
pre_check(user_code, soln_code = "hello")

Arguments

user_code

A character string containing the code to be checked. Note that this is a character string, not a checkr_result. Constructing a checkr_result requires that the code be evaluated, while this function is for pre-evaluation checking.

soln_code

Code, if any, containing a correct solution.

Value

A checkr_result object.

Examples

1
2
code <- "lm(mpg ~ hp, data <- mtcars); plot(1:10); x <- 1\n y <- x^2\n\n z = cos(yy * xx^2)"
pre_check(code)

dtkaplan/checkr documentation built on May 15, 2019, 4:59 p.m.