R/utils.R

Defines functions which_max_dist

# Find the poi result with the largest $dist from a list of results
# some of which may be NA
which_max_dist <- function(pois) {
  which.max(
    vapply(
      pois,
      function(x) ifelse(is.list(x), x$dist, NA_real_),
      double(1)
    )
  )
}

Try the polylabelr package in your browser

Any scripts or data that you put into this service are public.

polylabelr documentation built on April 4, 2025, 1:50 a.m.