extractA: Extracts dimension from array

Description Usage Arguments Examples

View source: R/all.R

Description

Extracts dimension from array

Usage

1
extractA(A, a, ...)

Arguments

A

a named array

a

a list of dimensions of A ( a subvector of 1:length(dim(A)) or a subvector of dimnames(A))

...

a vector the same length of a of integers. necessarily ...[i]<=dim(A)[a[i]]

Examples

1
2
3
4
5
6
A=array(1:(prod(2:4)),2:4);
dimnames(A)<-sapply(dim(A),seq_len)
names(dimnames(A))<-paste0("x",2:4)
extractA(A,integer(0),integer(0));
extractA(A,"x3",2);
extractA(A,c("x4","x3"),1,2);

DanielBonnery/TensorDB documentation built on April 26, 2020, 3:45 p.m.