parse_check: Look for errors at parse time

Description Usage Arguments Examples

View source: R/parse_check.R

Description

Parses the code (without evaluating it) to look for parse errors. If any are found, a somewhat friendly message is returned.

Usage

1
parse_check(user_code)

Arguments

user_code

a character string containing the code to parse. Note, the input cannot be a checkr_result, since constructing one of those requires the code to be executed.

Examples

1
2
3
4
5
6
code <- "lm(mpg ~ hp, \ndata == mtcars); \nplot(1:10)\n x <- f[b]\n y <- x^2\n\n z = cos(yy * xx^2)"
cat(parse_check(code)$message)
code2 <- "x <- 3\ny <- x^2\n__blank__ <- 2"
cat(parse_check(code2)$message)
code3 <- "x["
cat(parse_check(code3)$message)

dtkaplan/checkr2 documentation built on May 17, 2019, 4:01 p.m.