I am trying to measure the geographic and language distance between all countries and the United States (e.g. the distance between Canada and the USA, Iran and USA, and etc).
The data is available via http://www.cepii.fr/pdf_pub/wp/2011/wp2011-25.pdf but I am unsure how to actually calculate the distance with the long/lat info, and the language info.
Thanks!
Edited to add photo: I want to create a 4th variable that shows the distance between each country and the USA (38.8670000, -77.0000000). Example of data I know the distHaversine gives allows me to do this one by one, but how can I use the distHaversine to compute this for all the countries in my dataset (each country's distance to the US)
I tried this: mutate(geo, Distance = distHaversine(cbind(lon, lat), c(38.8670000, -77.0000000))) but it returns incorrect distances.