Skip to contents

This function checks whether the provided expression is a valid R expression and can be correctly parsed.

Usage

isValidExpression(custom_expression)

Arguments

custom_expression

The custom expression to validate.

Value

TRUE if the expression is valid, FALSE otherwise.

Examples

isValidExpression("x + 1")
#> [1] TRUE
isValidExpression("log(x +)")
#> Invalid custom expression:<text>:1:8: unexpected ')'
#> 1: log(x +)
#>            ^
#> [1] FALSE