# slice.index

##### Slice Indexes in an Array

Returns a matrix of integers indicating the number of their slice in a given array.

- Keywords
- array

##### Usage

`slice.index(x, MARGIN)`

##### Arguments

- x
an array. If

`x`

has no dimension attribute, it is considered a one-dimensional array.- MARGIN
an integer giving the dimension number to slice by.

##### Value

An integer array `y`

with dimensions corresponding to those of
`x`

such that all elements of slice number `i`

with respect
to dimension `MARGIN`

have value `i`

.

##### See Also

`row`

and `col`

for determining row and column
indexes; in fact, these are special cases of `slice.index`

corresponding to `MARGIN`

equal to 1 and 2, respectively when `x`

is a matrix.

##### Examples

`library(base)`

```
# NOT RUN {
x <- array(1 : 24, c(2, 3, 4))
slice.index(x, 2)
# }
```

*Documentation reproduced from package base, version 3.4.3, License: Part of R 3.4.3*

### Community examples

Looks like there are no examples yet.