Internal function that checks if a data frame is sorted by id (grouped), then by wave within each id. This is O(n) - just one pass through the data, much cheaper than O(n log n) sorting.
Internal function that checks if a data frame is sorted by id (grouped), then by wave within each id. This is O(n) - just one pass through the data, much cheaper than O(n log n) sorting.