Learn R Programming

exampletestr (version 1.3.1)

text_parse_error: Does parsing of text give an error?

Description

Can a character vector (where each line is treated as a line of R code) be parsed as an R expression (or several R expressions) without giving an error?

Usage

text_parse_error(text_expr)

Arguments

text_expr

The expression to be evaluated, as a character vector.

Value

TRUE if the code gives an error and FALSE otherwise.

Examples

Run this code
# NOT RUN {
text_parse_error("a <- 1")
text_parse_error("a <- ")
# }

Run the code above in your browser using DataLab