geosphere
is an R package for spherical trigonmetry. That is compute distance, direction, area, and related quantities with longitude / latitude data. There are tutorials at rspatial.org.
geosphere
is available from CRAN, so you can use install.packages("geosphere")
to get the current released version.
The easiest way to use the development version on Windows or MacOS, is to install it from the R-universe, like this:
install.packages('geosphere', repos='https://rspatial.r-universe.dev')
In R, you can install the package like this.
remotes::install_github("rspatial/geosphere")
On Windows, you need to first install Rtools to get a C++ compiler that R can use.