Error in .pointsToMatrix(p1) : latitude > 90

后端 未结 3 1998
情话喂你
情话喂你 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:21

    Having the same issue, solved with as.numeric :

    args <- commandArgs(trailingOnly=TRUE)
    Lieu1 <- c(args[1],args[2]) 
    Lieu2 <- c(args[3],args[4]) 
    
    Lieu1 <- as.numeric(Lieu1)
    Lieu2 <- as.numeric(Lieu2)
    
    library(geosphere)
    distVincentyEllipsoid(Lieu1,Lieu2)/1000
    

提交回复
热议问题