AggregateLayers: Aggregate Layers

Description Usage Arguments Value Examples

Description

Aggregate by country, country and year, or some other weight.

Usage

1
2
3
  aggregate_by_country(df, col.value = "value",
    col.country = "country_id",
    lyrs.dat.csv = layers_data.csv)

Arguments

df

Input data frame.

col.value

Column in data frame containing the value to be aggregated.

col.country

Column in data frame containing the country_id.

col.weight

Column in data frame containing the weight.

Value

These functions aggregate to region by either country, country and year, or just a weight. These are mostly only used for aggregating a goal's status or trend calculations to region.

Examples

1
2
3
4
5
6
## Not run: 
    aggregate_by_country(df, col.value='value', col.country='country_id')
    aggregate_by_country_weighted(df, w, col.value='value', col.country='country_id', col.weight='weight')
    aggregate_by_country_year(df, col.value='value', col.country='country_id')
  
## End(Not run)

bbest/ohigui documentation built on May 11, 2019, 9:25 p.m.