Remove duplicated country-year rows in UNICEF datasets, based on a specified priority order.
filter_unicef(df, priority)
data.frame: A pddcs
formatted data frame. Output of
fetch_indicator()
.
character: A vector with survey sources to prioritize between. See details.
data.frame
The abbreviation of survey sources in the note
column is used to
prioritize between different surveys if there are duplicated country-years.
Typical use cases are MIS, DHS, MICS and AIS. The surveys are prioritized in
the order they are listed, e.g. if priority = c('X', 'Y', 'Z')
, then X will
be chosen before Y, which again will be chosen before Z.