Alternatives to this process (NOTE: It looks like process has changed slightly since I wrote the alternative methods, so they might not work exactly as written anymore):
|
do.call(rbind, pblapply(seq_along(previous.sas.samples.path), |
|
function(x) |
|
transform( |
|
haven::read_sas(previous.sas.samples.path[x], |
|
col_select = "UDPRN"), |
|
filename = previous.sas.samples.path[x]))) %>% |
|
clean_names_modified() |
|
list_used_addresses <- c(list_used_addresses, list(prev.sas.samples)) |
|
} |
- Using
purrr as used elsewhere in the project anyway:
usedaddresses <- previoussamples.path %>%
purrr::map(\(x) haven::read_sas(x, col_select = "UDPRN") %>%
mutate(survey = x), .progress = TRUE) %>%
purrr::list_rbind()
- Using
furrr
future::plan(future::multisession, workers = 8)
usedaddresses <- previoussamples.path %>%
furrr::future_map_dfr(\(x) haven::read_sas(x, col_select = "UDPRN") %>%
mutate(survey = x), .progress = TRUE)
Alternatives to this process (NOTE: It looks like process has changed slightly since I wrote the alternative methods, so they might not work exactly as written anymore):
cssampling/scripts/02_used_addresses.R
Lines 38 to 46 in 2c98c18
purrras used elsewhere in the project anyway:furrr