if (FALSE) {
x <- randomGrid(15,30) # make random grid
i <- angleOrderIndexes2d(x) # make indexes for ordering
x <- x[i[[1]], i[[2]]] # reorder constructs and elements
x # print grid
}
Run the code above in your browser using DataLab