mclapply returning a list with NULL elements
Dear Nathan,
first, many thanks for making this package available. I've tried many times to code using the parallel package but never managed the following code to work. It always return a list with NULL elements. The code runs fine with lapply.
library(rGEDI) library(purrr) library(parallelsugar)
gedi.l2a.files <- list.files(pattern = glob2rx("GEDI02_A*.h5")) gedi.l2a.data <- lapply(gedi.l2a.files, rGEDI::readLevel2A) function.clip <- function(x) rGEDI::clipLevel2A(x, xmin = 12.2, xmax = 31.3, ymin = -13.5, ymax = 5.39) gedi.l2a.data.clip.par <- mclapply(gedi.l2a.data, purrr::possibly(function.clip, otherwise = NULL))
I don't know how to make this example reproducible, because each hdf5 file is pretty big. I can share them with you via google drive if you can provide an email.
Many thanks Joao