write_to_all_regions: write_to_all_regions

View source: R/module-helpers.R

write_to_all_regionsR Documentation

write_to_all_regions

Description

Copy data table to all regions, selecting which columns to keep.

Usage

write_to_all_regions(
  data,
  names,
  GCAM_region_names,
  has_traded = FALSE,
  apply_selected_only = TRUE,
  set_market = FALSE
)

Arguments

data

Base tibble to start from

names

Character vector indicating the column names of the returned tibble

GCAM_region_names

Tibble with GCAM region names and ID numbers

has_traded

Logical indicating whether any rows in the base table have "traded" goods; if true, set_traded_names will be called

apply_selected_only

Logical indicating whether set_traded_names is applied to the whole tibble, or only selected rows

set_market

Logical indicating whether to create a market.name column whose values are equal to region prior to set_traded_names re-setting region names

Value

Tibble with data written out to all GCAM regions.

Note

Used for data that GCAM contains within each region, but whose values are not actually differentiated by region.


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