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
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