I have two sets of geo location points i.e. latitude and longitude.
control <-
data.frame(
id = c("110000308033", "110000308042", "110000308060", "110000308346", "110000308505",
"110000308541", "110000308612", "110000309684", "110000309773", "110000309835"),
latitude = c(42.20227, 42.19802, 42.19251, 42.13690, 42.65253, 42.24066, 42.60008,
42.62743, 42.72361, 42.70060),
longitude = c(-72.606052, -72.600913, -72.609814, -72.542205, -73.110606, -73.358297,
-72.378388, -71.156079, -70.9629610, -71.16304)
)
treatment <-
data.frame(
id = c("110000308881", "110000310556", "110000314570", "110000316024", "110000324845"),
latitude = c(42.61366, 42.16657, 45.36801, 41.62371, 43.30851 ),
longitude = c(-71.633782, -71.212503, -68.510184, -72.043135, -73.63481 )
)
I want to find the shortest distance from control unit to treatment unit for each of the control unit. Also how can I show them on a US map. I would appreciate any help.
