| is_valid {lazy.symbolic} | R Documentation |
Check If the Input Expression is Valid
Description
Japanese help file: is_valid_JPH
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 the input expression is valid
meaning the following ok's are all zero.
errlist A list of error names if any.
ok A vector of the following check flags:
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
** : multiplicative operators at start or any oprs. at end
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 1.0.0.20250830 ]