Learn R Programming

calculus (version 0.3.2)

index: 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<-: set indices.

References

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

See Also

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

Examples

Run this code
# NOT RUN {
### 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)

# }

Run the code above in your browser using DataLab