I'm trying to find the center of Montana using the R centroid
function in the geosphere package. The lat/long coordinates are stored in a shape file stored in xx
that when calculated yield a result near Bermuda.
Any suggestions as to how to fix this?
geosphere::centroid(as.matrix(xx))
# lon lat
#[1,] -62.60957 28.57984
range(xx$long)
#-116.0492 -104.0391
range(xx$lat)
#44.38032 49.00091
Here's xx
: https://pastebin.com/uFgmph9g