# NOT RUN {
di <- c(2, 2, 3)
cell2entry(c(1, 1, 1), dim=di)
cell2entry(c(2, 2, 3), dim=di)
entry2cell(1, dim=di)
entry2cell(12, dim=di)
next_cell(c(1, 1, 1), dim=di)
next_cell(c(2, 1, 1), dim=di)
## The first two entries are kept fixed
next_cell_slice(c(2, 1, 1), dim=di, slice_marg=c(1, 2))
next_cell_slice(c(2, 1, 2), dim=di, slice_marg=c(1, 2))
## Cell (2, 2, 1) corresponds to entry 4
cell2entry(c(2, 2, 1), dim=di)
## Same as
cell2entry_perm(c(2, 2, 1), dim=di, perm=c(1, 2, 3))
## If the table dimensions are permuted as (3, 1, 2)
## the entry becomes
cell2entry_perm(c(2, 2, 1), dim=di, perm=c(3, 1, 2))
# }
Run the code above in your browser using DataLab