Error in .pointsToMatrix(p1) : latitude > 90

后端 未结 3 1959
情话喂你
情话喂你 2021-01-16 09:46

I am trying to use the distVincentyEllipsoid function in the geosphere package in R to calculate the distance between different points in my data frame, following the exampl

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-16 10:24

    I would also add that you should check for NAs. I geocoded a set of zip codes to coordinates and since some of the zips were out of date (at least that's what I think happened), they failed to generate coordinates.

    If you run:

    range(p1[2])
    

    and get

    NA NA
    

    then that's a pretty go indication.

提交回复
热议问题