%diff% {calculus}R Documentation

Numerical and Symbolic Difference

Description

Elementwise difference of numeric or character arrays.

Usage

x %diff% y

Arguments

x

numeric or character array.

y

numeric or character array.

Value

array.

References

Guidotti, E. (2020). "calculus: High dimensional numerical and symbolic calculus in R". https://arxiv.org/abs/2101.00086

See Also

Other basic arithmetic: %div%(), %dot%(), %inner%(), %kronecker%(), %outer%(), %prod%(), %sum%()

Examples

### vector 
x <- c("a+1","b+2")
x %diff% x

### matrix 
x <- matrix(letters[1:4], ncol = 2)
x %diff% x

### array
x <- array(letters[1:12], dim = c(2,2,3))
y <- array(1:12, dim = c(2,2,3))
x %diff% y


[Package calculus version 0.3.1 Index]