This is a suggestion for naming parameters. Some of them are a little confusing in the ratioOverlap() because it is possible that parameter 'r' is a polygon and parameter 'shp' could be a raster. I suggest changing to 'x' and 'y' (which is common in R functions that take two inputs). In R, the 'r' parameter is usually used to denote raster data, and 'shp' is for shapefiles. If accepted the suggestion, this means that some documentation and vignettes need to be changed.
Best,
Gonzalo