extract_country_data: Extract specific country data

View source: R/data_functions.R

extract_country_dataR Documentation

Extract specific country data

Description

Data is extracted according to the countries object in a way that is amenable to drake subtargets. dplyr::filter() does the subsetting.

Usage

extract_country_data(
  .df,
  countries,
  max_year,
  country = IEATools::iea_cols$country,
  year = IEATools::iea_cols$year
)

Arguments

.df

A data frame containing cleaned data with lots of countries.

countries

A list of 3-letter country codes for countries to be analyzed.

max_year

The latest year you want to include in the extracted data.

country, year

See IEATools::iea_cols.

Value

a data frame with the desired IEA data only

Examples

IEATools::sample_iea_data_path() %>%
  IEATools::load_tidy_iea_df() %>%
  extract_country_data(countries = c("ZAF"), max_year = 1999)

MatthewHeun/SEAPSUTWorkflow documentation built on April 22, 2022, 2:21 p.m.