Title: | Fetching Data from the 'Displacement Tracking Matrix' |
Version: | 0.0.3 |
Description: | Allows humanitarian community, academia, media, government, and non-governmental organizations to utilize the data collected by the 'Displacement Tracking Matrix' (https://dtm.iom.int), a unit in the International Organization for Migration. This also provides non-sensitive Internally Displaced Person figures, aggregated at the country, Admin 1 (states, provinces, or equivalent), and Admin 2 (smaller administrative areas) levels. |
URL: | https://github.com/Displacement-Tracking-Matrix/dtmapi-R, https://displacement-tracking-matrix.github.io/dtmapi-R/ |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
Imports: | httr2, jsonlite, magrittr |
Suggests: | knitr, rmarkdown, testthat (≥ 3.1.0) |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2025-06-23 11:19:26 UTC; bangtranl |
Author: | Luong Bang Tran [aut, cre] |
Maintainer: | Luong Bang Tran <lutran@iom.int> |
Repository: | CRAN |
Date/Publication: | 2025-06-23 11:40:02 UTC |
Fetch All Countries
Description
Retrieve all countries for which DTM data is publicly available through the API.
Usage
get_all_countries()
Value
A data frame containing the list of all countries.
Examples
## Not run:
# Fetch all countries
countries_df <- get_all_countries()
head(countries_df)
## End(Not run)
Fetch All Operations
Description
Retrieve all operations for which DTM data is publicly available through the API.
Usage
get_all_operations()
Value
A data frame containing the list of all operations.
Examples
## Not run:
# Fetch all operations
operations_df <- get_all_operations()
head(operations_df)
## End(Not run)
Fetch IDP Admin0 Data
Description
Retrieve IDP data at Admin 0 level based on specified parameters. At least one of the following parameters must be provided: Operation, CountryName, or Admin0Pcode.
Usage
get_idp_admin0_data(
Operation = NULL,
CountryName = NULL,
Admin0Pcode = NULL,
FromReportingDate = NULL,
ToReportingDate = NULL,
FromRoundNumber = 0,
ToRoundNumber = 0
)
Arguments
Operation |
Optional; Name of the DTM operation for which the data was collected. |
CountryName |
Optional; Name of the country where the data was collected. |
Admin0Pcode |
Optional; Country code (ISO 3166-1 alpha-3). |
FromReportingDate |
Optional; Start date for the reporting period (format: 'YYYY-MM-DD'). |
ToReportingDate |
Optional; End date for the reporting period (format: 'YYYY-MM-DD'). |
FromRoundNumber |
Optional; Starting round number for the data collection range. |
ToRoundNumber |
Optional; Ending round number for the data collection range. |
Value
A data frame containing the IDP Admin0 data matching the specified criteria.
Examples
## Not run:
# Fetch IDP data at Admin Level 0
idp_admin0_df <- get_idp_admin0_data(CountryName='Ethiopia', FromRoundNumber=1, ToRoundNumber=10)
head(idp_admin0_df)
## End(Not run)
Fetch IDP Admin1 Data
Description
Retrieve IDP data at Admin 1 level based on specified parameters. At least one of the following parameters must be provided: Operation, CountryName, or Admin0Pcode.
Usage
get_idp_admin1_data(
Operation = NULL,
CountryName = NULL,
Admin0Pcode = NULL,
Admin1Name = NULL,
Admin1Pcode = NULL,
FromReportingDate = NULL,
ToReportingDate = NULL,
FromRoundNumber = 0,
ToRoundNumber = 0
)
Arguments
Operation |
Optional; Name of the DTM operation for which the data was collected. |
CountryName |
Optional; Name of the country where the data was collected. |
Admin0Pcode |
Optional; Country code (ISO 3166-1 alpha-3). |
Admin1Name |
Optional; Name of level 1 administrative boundaries. |
Admin1Pcode |
Optional; Place code of level 1 administrative boundaries. |
FromReportingDate |
Optional; Start date for the reporting period (format: 'YYYY-MM-DD'). |
ToReportingDate |
Optional; End date for the reporting period (format: 'YYYY-MM-DD'). |
FromRoundNumber |
Optional; Starting round number for the data collection range. |
ToRoundNumber |
Optional; Ending round number for the data collection range. |
Value
A data frame containing the IDP Admin1 data matching the specified criteria.
Examples
## Not run:
# Fetch IDP data at Admin Level 1
idp_admin1_df <- get_idp_admin1_data(CountryName='Sudan', Admin1Name="Blue Nile")
head(idp_admin1_df)
## End(Not run)
Fetch IDP Admin2 Data
Description
Retrieve IDP data at Admin 2 level based on specified parameters. At least one of the following parameters must be provided: Operation, CountryName, or Admin0Pcode.
Usage
get_idp_admin2_data(
Operation = NULL,
CountryName = NULL,
Admin0Pcode = NULL,
Admin1Name = NULL,
Admin1Pcode = NULL,
Admin2Name = NULL,
Admin2Pcode = NULL,
FromReportingDate = NULL,
ToReportingDate = NULL,
FromRoundNumber = 0,
ToRoundNumber = 0
)
Arguments
Operation |
Optional; Name of the DTM operation for which the data was collected. |
CountryName |
Optional; Name of the country where the data was collected. |
Admin0Pcode |
Optional; Country code (ISO 3166-1 alpha-3). |
Admin1Name |
Optional; Name of level 1 administrative boundaries. |
Admin1Pcode |
Optional; Place code of level 1 administrative boundaries. |
Admin2Name |
Optional; Name of level 2 administrative boundaries. |
Admin2Pcode |
Optional; Place code of level 2 administrative boundaries. |
FromReportingDate |
Optional; Start date for the reporting period (format: 'YYYY-MM-DD'). |
ToReportingDate |
Optional; End date for the reporting period (format: 'YYYY-MM-DD'). |
FromRoundNumber |
Optional; Starting round number for the data collection range. |
ToRoundNumber |
Optional; Ending round number for the data collection range. |
Value
A data frame containing the IDP Admin2 data matching the specified criteria.
Examples
## Not run:
# Fetch IDP data at Admin Level 2
idp_admin2_df <- get_idp_admin2_data(Operation='Yemen conflict', CountryName="Yemen")
head(idp_admin2_df)
## End(Not run)