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

Description Usage Arguments Details Value

View source: R/pipeline-helpers.R

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

1
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.


rohmin9122/gcam-korea-release documentation built on Nov. 26, 2020, 8:11 a.m.