idmc_transform_daily {idmc} | R Documentation |
Transform displacement event data to daily data
Description
idmc_transform_daily()
transforms event data from the IDMC API (accessed
through idmc_get_data()
). The data for each event is spread out between
the start and end date, with the total displacement uniformly distributed
across all days. For each country and displacement type (conflict, disaster,
or other), all displacement on a day is summed up to create a total
daily displacement figure.
Usage
idmc_transform_daily(
df,
min_date = min(as.Date("2018-01-01")),
max_date = Sys.Date(),
filter_min_date = TRUE
)
Arguments
df |
Event displacement data frame, generated from |
min_date |
Date to backfill displacement data to. By default, |
max_date |
Date to extrapolate all data to, filling with |
filter_min_date |
If |
Details
By default, data is backfilled for all countries and displacement types to the first reported date in the IDMC dataset. Data is always infilled with 0 between start and end dates.
Value
Data frame of daily displacement with the following columns:
- iso3
Country ISO3 code.
- country
Country or area name.
- displacement_type
Type of displacement.
- date
Date.
- displacement_daily
Daily level of displacement.
Examples
idmc_get_data() %>%
idmc_transform_daily()