for_checkr: Translate a sequence of commands into a sequence of quosures

Description Usage Arguments Value Examples

Description

This function is the first step in any checkr sequence. It scans the quoted commands for parse errors, evaluates the lines one at a time, and packages up the lines into quosures with an environment in which the line should be executed. (That way the lines can be evaluated in a stand-alone manner.)

Usage

1
for_checkr(exprs)

Arguments

exprs

an expression or set of expressions in a curly brace

Value

a quosure for each expression in exs, with an associated environment that reflects the state when that expression was evaluated.

Examples

1
2
3
4
5
code <- for_checkr(quote({x <- 2; y <- x^2; z <- x + y}))
class(code)
passed(code)
line_where(code, insist(Z == "z", "No line with assignment to 'z'."))
line_where(code, insist(V == 4), insist(Z == "y"))

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