Codes and dataset for SPAG: Index of Spatial Agglomeration (Papers in Regional Science, 2019) https://doi.org/10.1111/pirs.12470
Kopczewska, K., Churski, P., Ochojski, A., & Polko, A. (2019). SPAG: Index of spatial agglomeration., Papers in Regional Science
It is also described in a book Kopczewska, K., Churski, P., Ochojski, A., & Polko, A. (2017). Measuring regional specialisation: A new approach. Springer. availabe at: https://link.springer.com/book/10.1007/978-3-319-51505-2
Files wojewodztwa and powiaty are open SHAPEFILE maps for Poland for NTS2 and NTS4 levels. File firms.csv contains example of point data for business location for lubelskie NTS2 region. SPAG code is in text file - works for this datasets. To adjust code for your dataset - define border as region object and subset with geocoded data with 4 columns only (x,y, firm size, sector).
If powiaty map does not work, please download in zip from here: https://www.sugarsync.com/pf/D1836703_09668593_6847342