pre_check: Pre-check code

Description Usage Arguments Value Examples

View source: R/pre_check.R

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 list containing fields correct and message. If correct is TRUE

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/checkr2 documentation built on May 17, 2019, 4:01 p.m.