array_index: Find the numerical indices in an array.

Description Usage Arguments Value

View source: R/array_index.R

Description

This function will identify the numerical indices that corresponds to a selection based on a character vector, by comparing it to a list representing the dimension-names to be used.

Usage

1
array_index(.bookmark, .dimnames, .check_dimnames = TRUE)

Arguments

.bookmark

The caracter vector to be used for the selection. (If a list is detected, it will be converted to a vector first.) This vector must have the same length as the list in the .dimnames-argument. If .bookmark is a named vector, then the names must be the same as those encountered in .dimnames (but not necessarily in the same order).

.dimnames

The list of dimension names. It will be assumed that this is a named list of character vectors, and it will also be assumed that the names (and the content of the individual character vectors) are unique. A test of the validity of .dimnames will be performed when .check_dimnames is given as TRUE (default).

.check_dimnames

A logical value, default TRUE, that can be used to check that .dimnames satisfies the required uniqueness requirements.

Value

The result will be a vector of integers, which can be used as an alternative to .bookmark for the subsetting.


LAJordanger/leanRcoding documentation built on Feb. 27, 2020, 4:42 p.m.