This version of `peak` does deal with the coordinates in turn. I did write another version that dealt with all the coordinates at once, which didn't require any additional arguments, but it took a considerably long time to complete and I didn't think the fitted spline would always represent the data correctly. 

In the current version, I overlooked the fact that the results could be different if the coordinates are in a different order, so will look at applying the aggregator multiple times when dealing with multiple coordinates, as suggested, so the coordinate order can be maintained. Thanks.