Find central point for list of lat/long coordinates
get_centroid(lat, lng, coord.unit = c("degrees", "radians"))
lat | A quoted string indicating what named value in the bounding box represents latitude. If NULL, will be inferred from bounding box names. |
---|---|
lng | A quoted string indicating what named value in the bounding box represents longitude. If NULL, will be inferred from bounding box names. |
coord.unit | The unit latitude and longitude are stored in. |
df <- data.frame( lat = c(44.05771, 44.18475), lng = c(-73.99212, -73.81515) ) get_centroid(df$lat, df$lng)#> lat lng #> 44.12126 -73.90373