Create an array from a list of an indexes

create_array(value = 1, indexes)

Arguments

value

A numeric vector with the value(s) to fill the array

indexes

A named list with the indexes of the array

Value

An array with the dimensions equal to the length of each index.

Examples

create_array(value = 1, indexes = list(i = c("a", "b"), j = c("c", "d")))
#> j #> i c d #> a 1 1 #> b 1 1