powered by
indexToPosition(x, nrow = 1)
x
which
indexToPosition(3, 2) indexToPosition(c(1, 4, 5, 7, 9), 3) indexToPosition(1:16, 4) indexToPosition(c(1, 3, 5, 6, 8, 10, 11, 13, 15), 5)
Run the code above in your browser using DataLab