Converts a vector of LSOA codes from one vintage to the other with the
bundled ONS lookup (lamp_lsoa_lookup()) and reports how many areas were
unchanged, split, merged or complex. From 2011 to 2021 each code maps to
its best-fit 2021 LSOA. From 2021 to 2011 unchanged and split LSOAs map to
their single parent; a 2021 LSOA formed by a merger maps to the first of
its parents in code order, so lsoa21 panels are the recommended target.
Value
A list with codes (the mapped vector, NA where a code is not
in the lookup) and summary (counts of records and distinct areas by
change type and the share of areas that were split or merged).
Examples
r <- lamp_revintage(c("E01000001", "E01000002", "E01033768"), from = "lsoa11", to = "lsoa21")
r$codes
#> [1] "E01000001" "E01000002" "E01033768"
r$summary$share_split_or_merged
#> [1] 0