is_valid {lazy.symbolic}R Documentation

Check If the Input Expression is Valid

Description

Check If the Input Expression is Valid

Usage

is_valid(expr, print = 0)

Arguments

expr

An expression as a string

print

= 1 to print the result

Details

Use find_varfunc(expr) to list variables/functions in expr.

Value

A list of checks
valid = TRUE if theinput expression is valid.
errlist A list of error names if any.
ok A list of the following check list items:

ubp : unbalanced parentheses
)a : no operators after )
+)|(* : parenthesis after or before an operator
*+ : operators w/o variables
/+ : operators w/o variables
1a : number followed by alpha or left paren

errflag return values from regexpr

Examples

is_valid( "a+b/c" )
is_valid( "a*(b+c)d +9f(a)" )
is_valid("a-b(c-2d-1*(e+f)-g+))a+*(h1a(x+g(y)/+4)+(i+j))", print=1)
is_valid("(v+v+(v+(+v+v)+v)+((+v*(+((+(v)*v))))+v))+(v)+v+v*v)")


[Package lazy.symbolic version 0.1.4 Index]