View source: R/pipeline-helpers.R
change_iso_code | R Documentation |
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")
d |
The data to be transformed |
from |
The old ISO code |
to |
The replacement ISO code |
col |
The name of the columns with the ISO codes (default = 'iso') |
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.
Tibble with the old iso code replaced by the new one.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.