powered by
arrayInd(ind, .dim, .dimnames = NULL, useNames = FALSE)
dimnames(.)
.dimnames[[1]]
arrayInd()
x
C
base
Given a vector of integers giving the vector position of entries in an array, returns the appropriate array indices.
arrayInd
arr = array(1:36, dim=c(2,3,2,3)) ind = arrayInd(c(4,9,17), c(2,3,2,3)) ind arr[2,2,1,1] arr[1,2,2,1] arr[1,3,1,2]
Run the code above in your browser using DataLab