bindtensor: A cbind/rbind for tensors

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Tensors can be put side by side in one dimension if they are of equal size in all other dimensions.

Usage

1
bind.tensor(A,dA=NULL,B,dB=dA)

Arguments

A

the first tensor

dA

the dimension of A to be used for binding the tensors

B

the second tensor

dB

the dimension of B to be used for binding the tensors

Details

This function works like a cbind or rbind function for tensors.

Value

a tensor with the tensors combined to one

Note

binding does not preserve the sequence of the dimensions.

Author(s)

K.Gerald van den Boogaart

See Also

base{cbind}

Examples

1
2
3
  A <- to.tensor(1:6,c(a=2,b=3))
bind.tensor(A,"a",A)
bind.tensor(A,"b",A)

Example output

Attaching package: 'tensorA'

The following object is masked from 'package:base':

    norm

      a
b      [,1] [,2] [,3] [,4]
  [1,]    1    2    1    2
  [2,]    3    4    3    4
  [3,]    5    6    5    6
attr(,"class")
[1] "tensor" "matrix"
      b
a      [,1] [,2] [,3] [,4] [,5] [,6]
  [1,]    1    3    5    1    3    5
  [2,]    2    4    6    2    4    6
attr(,"class")
[1] "tensor" "matrix"

tensorA documentation built on Nov. 20, 2020, 9:07 a.m.

Related to bindtensor in tensorA...