index: Tensor Indices

View source: R/utils.R

indexR Documentation

Tensor Indices

Description

Functions to get or set the names of the dimensions of an array.

Usage

index(x)

index(x) <- value

Arguments

x

array.

value

vector of indices.

Value

Vector of indices.

Functions

  • index(x) <- value: set indices.

References

Guidotti E (2022). "calculus: High-Dimensional Numerical and Symbolic Calculus in R." Journal of Statistical Software, 104(5), 1-37. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v104.i05")}

See Also

Other tensor algebra: contraction(), delta(), diagonal(), einstein(), epsilon()

Examples

### array with no indices
x <- array(1, dim = c(1, 3, 2))
index(x)

### indices on initialization
x <- array(1, dim = c(i=1, j=3, k=2))
index(x)

### set indices on the fly
x <- array(1, dim = c(1, 3, 2))
index(x) <- c("i", "j", "k")
index(x)


calculus documentation built on March 31, 2023, 11:03 p.m.