index <- as_index(matrix(1:9, 3))
# Make period 0 the fixed base period
chain(index)
# Chaining and unchaining reverse each other
all.equal(index, unchain(chain(index)))
# Change the base period to period 2 (note the
# loss of information for period 0)
index <- chain(index)
rebase(index, index[, 2])
Run the code above in your browser using DataLab