Loading the geosphere package you can use a number of different functions
library(geosphere)
distm(c(lon1, lat1), c(lon2, lat2), fun = distHaversine)
Also:
distHaversine()
distMeeus()
distRhumb()
distVincentyEllipsoid()
distVincentySphere()
…
More Related Contents:
- Geographic / geospatial distance between 2 lists of lat/lon points (coordinates)
- R – Finding closest neighboring point and number of neighbors within a given radius, coordinates lat-long
- How should I deal with “package ‘xxx’ is not available (for R version x.y.z)” warning?
- Cannot install R-forge package using install.packages
- How to efficiently calculate distance between pair of coordinates using data.table :=
- Latitude Longitude Coordinates to State Code in R
- No visible binding for global variable Note in R CMD check
- R – How to get row & column subscripts of matched elements from a distance matrix
- How to select a CRAN mirror in R
- inst and extdata folders in R Packaging
- How to Convert data frame to spatial coordinates
- No RTools compatible with R version 3.5.0 was found
- Rscript: There is no package called …?
- How do you use multiple versions of the same R package?
- Check if point is in spatial object which consists of multiple polygons/holes
- “import as” in R
- Find K nearest neighbors, starting from a distance matrix
- How to find out which package version is loaded in R?
- R – when trying to install package: InternetOpenUrl failed
- R create reference manual with R CMD check
- What is the benefit of import in a namespace in R?
- Buffer (geo)spatial points in R with gbuffer
- R Plot Filled Longitude-Latitude Grid Cells on Map
- R: what’s the proper way to overwrite a function from a package?
- list of masked functions in R
- Add raster to ggmap base map: set alpha (transparency) and fill color to inset_raster() in ggplot2
- R install package loaded namespace
- How to convert docx to PDF?
- Difference between r-base and r-recommended packages
- Error in loading rgl package with Mac OS X