change_iso_code: Change a particular ISO code in a table to another code.

View source: R/pipeline-helpers.R

change_iso_codeR Documentation

Change a particular ISO code in a table to another code.

Description

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.

Usage

change_iso_code(d, from, to, col = "iso")

Arguments

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

Details

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.

Value

Tibble with the old iso code replaced by the new one.


JGCRI/gcamdata documentation built on March 21, 2023, 2:19 a.m.