Detecting geographic clusters
I have a R data.frame containing longitude, latitude which spans over the entire USA map. When X number of entries are all within a small geographic region of say a few degrees longitude & a few degrees latitude, I want to be able to detect this and then have my program then return the coordinates for the geographic bounding box. Is there a Python or R CRAN package that already does this? If not, how would I go about ascertaining this information? I was able to combine Joran's answer along with Dan H's comment. This is an example ouput: The python code emits functions for R: map() and rect().