0

I try to find groups of points within a radius of 300 meters that gather the highest amount. I am looking for the coordinates of this point. Note that the center point of the area that gather the highest amount has no reason to be a point in data frame observations.

I have the following data:

observations <- spatialrisk::insurance %>%
  dplyr::select(amount, lon, lat)

The function spatialrisk::concentration determines the concentration for all target points (i.e. sub):

spatialrisk::concentration(sub = observations, 
                           full = observations, 
                           value = amount, radius = 300)

The function is written in C++ (Rcpp), and is therefore fast. However, the approach is not 'smart'.

Any ideas for a faster solution with the raster (or velox) package? Or with a kernel density approach.

mharinga
  • 1,708
  • 10
  • 23

0 Answers0