Extract specific country data
extract_country_data.Rd
Data is extracted according to the countries
object in a way that is amenable to drake subtargets.
dplyr::filter()
does the subsetting.
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
.
Examples
IEATools::sample_iea_data_path() %>%
IEATools::load_tidy_iea_df() %>%
extract_country_data(countries = c("ZAF"), max_year = 1999)
#> # A tibble: 98 × 11
#> Country Method Energy.type Last.stage Year Ledger.side Flow.aggregation.poi…
#> <chr> <chr> <chr> <chr> <dbl> <chr> <chr>
#> 1 ZAF PCM E Final 1971 Supply Total primary energy…
#> 2 ZAF PCM E Final 1971 Supply Total primary energy…
#> 3 ZAF PCM E Final 1971 Supply Total primary energy…
#> 4 ZAF PCM E Final 1971 Supply Total primary energy…
#> 5 ZAF PCM E Final 1971 Supply Total primary energy…
#> 6 ZAF PCM E Final 1971 Supply Total primary energy…
#> 7 ZAF PCM E Final 1971 Supply Total primary energy…
#> 8 ZAF PCM E Final 1971 Supply Total primary energy…
#> 9 ZAF PCM E Final 1971 Supply Total primary energy…
#> 10 ZAF PCM E Final 1971 Supply Total primary energy…
#> # … with 88 more rows, and 4 more variables: Flow <chr>, Product <chr>,
#> # Unit <chr>, E.dot <dbl>