The R package gravity.distances provides distances between geographic entities — such as countries, US states or Canadian provinces — that are consistent with the gravity equation in international economics.
To install the package in R, simply run the following commands:
For more details and usage examples check out the respective Github repositories:
Time-varying aggregate distances between 193 countries computed using nighttime lights data as weights, for the years 1992–2012. For more detailed data, including θs ranging from -2 to +1 and distances between other geographic entities (currently US states, Canadian provinces), the use of the R package gravity.distances is highly recommended (see above).