Skip to content

Commit

Permalink
Merge pull request #1 from SESjo/SESjo-patch-dist2land
Browse files Browse the repository at this point in the history
unlist tmp to match dist2land's output with Windows
  • Loading branch information
SESjo committed Jun 22, 2023
2 parents 52ebb8a + fa3d8b3 commit 5e044ea
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions R/dist2land.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ dist2land <- function(data, lon = NULL, lat = NULL, shapefile = NULL, proj.in =
cl <- parallel::makeCluster(cores, rscript_args = c("--no-init-file", "--no-site-file", "--no-environ"))
out <- parallel::parLapply(cl, 1:length(x), function(i) suppressWarnings(rgeos::gDistance(x[i], land)/1000))
parallel::stopCluster(cl)
tmp <- unlist(out)
}
else {
tmp <- unlist(parallel::mclapply(1:length(x), function(i) {
Expand Down

0 comments on commit 5e044ea

Please sign in to comment.