R/pipeline-helpers.R
change_iso_code.Rd
A few countries have changed their ISO codes over time. Usually this is because countries split or merged; occasionally it's because they just didn't like the old one. This function allows us to insert an ISO code change into a pipeline.
change_iso_code(d, from, to, col = "iso")
The data to be transformed
The old ISO code
The replacement ISO code
The name of the columns with the ISO codes (default = 'iso')
Tibble with the old iso code replaced by the new one.
If you're dealing with a split or a merger, then making this change will generally create duplicate rows, so you should follow it up with an appropriate aggregation.