Skip to content

Reading used address file method #8

@tomwilsonsco

Description

@tomwilsonsco

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))
}

  1. 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()
  1. 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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions