wrap {calculus}R Documentation

Wrap Characters in Parentheses

Description

Wraps characters in round brackets.

Usage

wrap(x)

Arguments

x

character.

Details

Characters are automatically wrapped when performing basic symbolic operations to prevent unwanted results. E.g.:

a+b * c+d

instead of

(a+b) * (c+d)

To disable this behaviour run options(calculus.auto.wrap = FALSE).

Value

character.

References

Guidotti E (2022). "calculus: High-Dimensional Numerical and Symbolic Calculus in R." Journal of Statistical Software, 104(5), 1-37. doi:10.18637/jss.v104.i05

See Also

Other utilities: c2e(), e2c(), evaluate()

Examples

### wrap characters
wrap("a+b")

### wrap array of characters
wrap(array(letters[1:9], dim = c(3,3)))


[Package calculus version 1.0.1 Index]