alan-turing-institute / uatk-spc

Synthetic Population Catalyst
https://alan-turing-institute.github.io/uatk-spc/
MIT License
20 stars 12 forks source link

Make first step (raw_to_prepared.R) fully runnable #63

Closed HSalat closed 7 months ago

HSalat commented 1 year ago

Currently, after running raw_to_prepared.R, the four ageRescale---.csv files are missing from the zip file.

To restore them, it is necessary to:

1. Run SPENSER for all LADs in England

2. Run the current version of raw_to_prepared.R fully

3. Run some bits of SPC_pipelineLAD.R for all of England

https://github.com/alan-turing-institute/uatk-spc/blob/main/scripts/data_prep/SPC_pipelineLAD.R#L1-L58 and https://github.com/alan-turing-institute/uatk-spc/blob/main/scripts/data_prep/SPC_pipelineLAD.R#L92-L140

Requires:

4. Run the rest of raw_to_prepared_Income.R

First, load the data created during step 3 following: https://github.com/alan-turing-institute/uatk-spc/blob/main/scripts/data_prep/raw_to_prepared_Income.R#L326-341 And use it to run: https://github.com/alan-turing-institute/uatk-spc/blob/main/scripts/data_prep/raw_to_prepared_Income.R#L583-726

This should create the missing files that can then be added to the zip file.

--

Then, to get the Azure data:

5. Run the current version of SPC_pipelineLAD.R

source("SPC_loadWorkspace.R")

# Select year
date <- 2012

# Select lad
lad <- "E06000002"
lads <- sort(unique(lu$LAD20CD[lu$Country == "England"]))

for(i in lads){
  lad <- lads[i]
  source("SPC_pipelineLAD.R")
}