spocc icon indicating copy to clipboard operation
spocc copied to clipboard

suggestions: adding the progress bar of the function occ

Open Otoliths opened this issue 3 years ago • 1 comments

suggestions: Tracking mclapply with progress bar, replace the all lapply in function occ with pbmclapply

occs <- function (query = NULL, from = "gbif", limit = 500, start = NULL, 
          page = NULL, geometry = NULL, has_coords = NULL, ids = NULL, 
          date = NULL, callopts = list(), gbifopts = list(), bisonopts = list(), 
          inatopts = list(), ebirdopts = list(), ecoengineopts = list(), 
          vertnetopts = list(), idigbioopts = list(), obisopts = list(), 
          alaopts = list(), throw_warnings = TRUE, mc.cores) 
{
 .....
      for (i in seq_along(query)) {
        tmpres <- pbmcapply::pbmclapply(geometry, mc.cores = mc.cores, function(b) {
          loopfun(z = b, y = limit, s = start, p = page, 
                  x = query[[i]], hc = has_coords, d = date, 
                  w = callopts)
        })
.....

Otoliths avatar Jul 13 '20 17:07 Otoliths

thanks, i'll consider a progress bar, i wouldn't import a package for that, would just use base R, but will think about it. it's a bit more complicated than that because there are other paths where queries happen in the function

sckott avatar Jul 13 '20 18:07 sckott