remove_paren0 {lazy.symbolic} | R Documentation |
Remove redundant parentheses around a single term from an expression
Description
Remove redundant parentheses around a single term from an expression
Usage
remove_paren0(expr, debug = 0)
Arguments
expr |
an expression or a string |
debug |
= 1 to print intermediate result |
Value
a string
Examples
remove_paren0("(A*B)") # one term in ()
remove_paren0("(A+B)") # two terms in ()
expr="A%*%(t(B)%*%(diag(C+D))%*%E)"
remove_paren0( expr )
expr="E+(diag(F)%*%(G%*%(H-I+(t(J)-K-L))+(M*M))+diag(N))"
remove_paren0( expr )
remove_paren( expr )
[Package lazy.symbolic version 1.0.0.20250830 ]