вы можете попробовать параллельную обработку
#points being the spatialpointsdataframe, and lines being your spatiallinesdataframe
require(parallel)
fun<-function(i) data.frame(dist2Line(points[i,], lines)) #some function like this
cl <- makeCluster(detectCores())
clusterEvalQ(cl, { library("geosphere") }) #don't know what this does, but it's how i learned this.
clusterExport(cl, c("dist2Line", "points", "lines")) #here you have to include all your objects and functions you want to use, and export them to a cluster, whatever that is.
results <- parLapply(cl,1:length(points),fun=fun) #use parLapply to 'loop' through the points and return a list of dataframes. should be a list.