Skip to contents

The database can benefit from continent and World aggregations. This function bundles those aggregations into a single function.

Usage

region_pipeline(
  .psut_data,
  region_aggregation_map,
  continent_aggregation_map,
  world_aggregation_map,
  country = Recca::psut_cols$country,
  year = Recca::psut_cols$year,
  region = "Region",
  continent = "Continent",
  world = "World"
)

Arguments

.psut_data

A data frame of PSUT information.

region_aggregation_map

An aggregation map that shows how to aggregate countries to regions, like FoSUN and FoYUG. Entries in the each sublist are not assumed to be unique across sublists. I.e., a country could be in more than one region.

continent_aggregation_map

An aggregation map that shows how to aggregate countries to continents. Entries in the each sublist are assumed to be unique across sublists. I.e., each country is in one and only one continent.

world_aggregation_map

An aggregation map that shows how to aggregate continents to the world.

country

The name of the country column. Default is Recca::psut_cols$country.

year

The name of the year column. Default is Recca::psut_cols$year.

region

The name of the region column. Default is "Region".

continent

The name of the continent column. Default is "Continent".

world

The name of the world column. Default is "World".

Value

A data frame that includes new "Country"s for regions, continents, and the World.

Details

All regional aggregations have names that are 5 characters or longer.