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. (2020). "calculus: High dimensional numerical and symbolic calculus in R". https://arxiv.org/abs/2101.00086

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 0.3.1 Index]