is_valid {lazy.symbolic} | R Documentation |
Check If the Input Expression is Valid
is_valid(expr, print = 0)
expr |
An expression as a string |
print |
= 1 to print the result |
Use find_varfunc(expr)
to list variables/functions in expr.
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
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)")