agg_score: Aggregate scores at specified aggregation level

Description Usage Arguments Value Examples

View source: R/aggregation.R

Description

Aggregate scores at specified aggregation level

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
agg_score(
  data,
  context,
  context_AP,
  WSC_AP,
  agg_level = "admin2",
  WIS_water = WSC::WIS_water,
  WIS_sanitation = WSC::WIS_sanitation,
  WIS_final = WSC::WIS_final
)

Arguments

data

data.frame containing the data to be analysed with the function

context

Character string identifying the context to be used in the function call. This is to be used if multiple context (geographical or temporal) are being analysed. For instance, if data is used for Burkina Faso in 2020 and 2019, this column can help distinguish the indicators.

context_AP

data.frame with context specific analysis plan (AP) that links the indicators in the WSC AP to the datasets used in the context analysis. See an example [here](https://docs.google.com/spreadsheets/d/1Pv1BBf32faE6J5tryubhVOsQJfGXaDb2t23KWGab52U/edit?usp=sharing) or in “'WSC::context_AP“'.

WSC_AP

data.frame with the general WSC analysis plan (AP) than can be found here or as an object in the package (“'WSC::WSC_AP“')

agg_level

character string specifying which column should be used to aggregate the data. This is is typically an administrative unit (e.g. province, region, departement, admin2, etc.)

WIS_water

data.frame with the scoring reference matrix for the Water component of the WASH Insecurity Score (WIS)

WIS_sanitation

data.frame with the scoring reference matrix for the Sanitation component of the WIS

WIS_final

data.frame with the scoring reference matrix for the final score of the WIS

Value

data.frame containing the aggregated data according to context_AP and WSC_AP

Examples

1
2
agg_score(context = "bfa_2020", context_AP = WSC::context_AP,
          WSC_AP = WSC::WSC_AP, data = WSC::bfa_msna_2020)

ElliottMess/WSC documentation built on Jan. 8, 2021, 12:42 a.m.