assert_is_valid_r_code

0th

Percentile

Is the input valid R code?

Check to see if the input is a valid (parseable) R code.

Usage
assert_is_valid_r_code(x, severity = getOption("assertive.severity",
  "stop"))

is_valid_r_code(x, .xname = get_name_in_parent(x))

Arguments
x

Input to check.

severity

How severe should the consequences of the assertion be? Either "stop", "warning", "message", or "none".

.xname

Not intended to be used directly.

Value

TRUE if the input string is valid R code.

See Also

parse

Aliases
  • assert_is_valid_r_code
  • is_valid_r_code
Examples
# NOT RUN {
is_valid_r_code("x <- 1 + sqrt(pi)")
is_valid_r_code("x <- ")
is_valid_r_code("<- 1 + sqrt(pi)")
# }
Documentation reproduced from package assertive.code, version 0.0-3, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.