Using R in the humanitarian sector: the Response monitoring use case
The humanitarian response system is a network of donors, UN agencies, and non-governmental organizations (NGOs) that provide life saving assistance - as well as basic services like water and sanitation, schooling, and health care —to people affected by natural disaster, war, and forced migration. The scale of operations is enormous, with more USD$24 billion in funds mobilized in 2023 to respond to the needs of 216 million people in 69 countries.
The humanitarian sector uses data to improve the effectiveness of their operations. This ranges from needs assessment data —“how many people need food and where?”, to response monitoring data —“What is being done to address humanitarian needs”, so that operational gaps can be identified.
Response monitoring datasets are collected from humanitarian organizations and structured by their information management teams. Such data is key to understanding the situation at the local, country or regional level and to detect unaddressed needs early enough. Structuring such data enables informed decision making, targeted response efforts in support of affected populations as well as “Aid Transparency”. In protracted crises, working with this kind of data makes it possible to understand the situation better and to offer activities that can bridge humanitarian and development responses.
In May 2014, the activityinfo-R package  was created to ease the usage of R Statistical language in combination with the ActivityInfo platform, a web-based, offline-capable relational database developed for the sector. In this article, we will be looking at some use cases where this package has been used by UNHCR Field Staff to improve data management processes, as well as data analysis and presentation.
R for strategic planning processes and calculations for complex indicators by UNHCR in Iraq
The international humanitarian system started operating in Iraq in 2014 to address humanitarian needs resulting from ISIL, and the population displacement due to its violence. From January 2014 to December 2021, the UN and humanitarian partner organizations offered life-saving assistance to nearly seven million Iraqi citizens, across nine governorates, in dozens of Internally Displaced People (IDP) camps and in thousands of other locations in multiple conflict-affected governorates across Iraq. Today, an estimated 1.2 million people across Iraq remain internally displaced.
Since 2022, UNHCR in Iraq is supporting the gradual transition of the country from an emergency response to a longer-term development approach assisting Internally Displaced People (IDPs), returnees, refugees and host communities with social protection systems and access to public services and to the labor market. The strategic planning process, the analysis of complex indicators, task scheduling and data validation are crucial for the organization.
The UNHCR Information Management (IM) team combines R and Java technologies with the data collection system they have built in the ActivityInfo platform to automate multiple data processing steps. This innovative approach makes the data management process more efficient and accurate. As they have achieved seamless integration, they can accommodate data from multiple sources and with the use of Shiny, they create a streamlined, multi-step process interface for capturing and automating data processing for multiple rows hosted in ActivityInfo.
As far as planning is concerned, the IM team has developed an automated production tool for generating monitoring data utilizing Java and facilitating the production of 5W Database with low efforts for planning data entry. With planning data the organization can detect the needs and priorities of the affected population, determine the resources required, and set realistic goals and objectives. The indicators and outputs defined at the planning stage help to monitor the progress towards these goals and to adjust as necessary to ensure that assistance is reaching those who need it most. Through the Java REST API and JSON processing, the IM team taps into valuable planning data collected via ActivityInfo. This solution has drastically reduced the time spent entering repetitive data, optimizing the overall operational efficiency.
In addition, integrating R and ActivityInfo the team handles the calculation of complex indicators more efficiently. R allows for easier integration of various data types, such as narrative information, and it allows the generation of advanced reports in multiple formats like PDF, Word, and Excel with just one base code. This has significantly streamlined the reporting processes, enabling generating various outputs from the same dataset.
Then, as R offers the functionality to schedule tasks, the IM team has automated certain data processing tasks using specific R packages, freeing up the team to focus on other essential duties. Finally, using R the team has established robust validation processes for the collected indicators. This strategic approach guarantees data quality and reliability and enables the effective management of complex data validations.
The information has been provided by Stanyslas Matayo, Senior Information Management Officer in UNHCR Iraq who states:
“Integrating R with ActivityInfo has transformed our data management approach at the heart of our operations, bringing about substantial enhancements in complex indicator calculations, data utilization, task automation, and information sharing. The interplay of ActivityInfo and R exhibits our dedication to innovation, efficiency, and collaborative efforts across all aspects of our data management processes. Additionally, the seamless collaboration of ActivityInfo, R, and Java has bridged functional gaps, paving the way for significant advancements in our data processing and management capabilities. This innovative integration enables us to manage intricate tasks, handle diverse data sources, and consistently deliver reliable, valuable outputs. Our approach symbolizes our persistent commitment to leading the charge in efficient and effective data management, ensuring we always stay at the cutting edge of data-driven solutions.”
You can find more information on the GitHub repository.
R for reporting for the Protection sector in Lebanon
In Lebanon, the Government estimates that the country hosts 1.5 million Syrian refugees and 13,715 refugees of other nationalities. UNHCR coordinates the protection response for all refugees in Lebanon with the Government, UN agencies, and local and international partners, including registration; protection/border monitoring and advocacy; legal aid; civil documentation; psychosocial support; child protection; prevention and response to gender-based violence; and resettlement to third countries.
The Information Management hub of the Inter-Agency unit is responsible for monitoring the sectoral funding and the implementation of activities, the presence of partner organizations, and how many services are offered and to whom. Partner organizations working in the field report quantitative data on a monthly basis to the Inter-Agency using ActivityInfo, an information management platform for humanitarian and development operations.
The protection sector has begun using R, via the ActivityInfo API to produce an automated HTML report that is sent to sector coordinators as well as protection coordinators in the field. These findings are then used to understand the progress being made by the sector towards established annual targets, identify gaps in the reach of protection programming, and inform written reports.
The protection sector developed the described automated compilation tool to improve the monitoring of activity reporting in multiple ways:
- Time saved - Expedited and automated data wrangling in combination with data visualization saves time.
- Simplified and interactive interface - Producing this report in an HTML format using R creates a sleek, accessible and secure interface that facilitates easy navigation through the reported results.
- Improved Accessibility - The HTML report format makes reported data more accessible as it can be opened without special software within a web browser and displays all findings through intuitive ggplot data visuals.
As a result of this initiative, information management officers have more time to address other pressing tasks, the interpretation of findings has been simplified making the activity reporting results more accessible to non-data savvy users, and introducing a new, innovative standardized information product to the Inter-Agency.
Previous to this solution, the data would be manually downloaded, and plugged into an excel spreadsheet to populate an excel dashboard. For those without Information Management expertise, navigating that system could sometimes be challenging.
This information has been provided by Nara McCray, Associate IM Officer in UNHCR.
In the Response for Venezuela (R4V), R is used for data quality control and aggregation for the region
With over 7.7 million refugees and migrants from Venezuela, the Inter-Agency Coordination Platform for Refugees and Migrants for Venezuela (R4V) reports and monitors its humanitarian and development response using ActivityInfo and R in 17 countries by over 300 partner organizations that report their activities every month in the Latin America and the Caribbean region. Given the scale of this response (the world’s largest coordinated response), the diverse types of population assisted, and the multiple partners involved, ensuring data quality and correct data aggregations is paramount.
For this reason, the regional team created a web-based application to facilitate the data quality check process through a script focused on ensuring data completeness, consistency, and accuracy. To avoid erroneous or incomplete data, the team leverages ActivityInfo and its data importer with an R script and a Shiny App, through which erroneous or missing data is flagged for subsequent revisions.
In addition to data quality control, thanks to the script, it is possible to evaluate alternative models of data aggregation to create a consolidated report on the assistance being provided by sector, country, and administrative level-1. As the analysis can be reproduced, the Platform can test various scenarios based on the collected data and a variety of outputs can be generated to meet different needs. The scripted approach also allows the users to look into the situation in more detail, as they can create tailored analysis and information products for each country, partner and sector.
The project was built using the Activityinfo R package and the graveler project template. It includes a Shiny App combined with functions which makes it possible to pull information such as partner organization, country and more, as well as 5W information using the ActivityInfo API. It also performs QA on the data, and then moves on to the data aggregation according to different scenarios.
As a result, the regional and national R4V IM teams save valuable time and energy, while encouraging data quality and report reproducibility among partner organizations.
This information has been provided by Fernanda Chacón, Information Management Officer in UNHCR/R4V, Matheus Soldi Hardt, Information Management Officer, UNHCR Bureau of the Americas and Edouard Legoupil, Senior Data Analysis Officer, UNHCR Bureau of the Americas. You can read more about the tool on its GitHub repository.
- You may also check https://humanitarian-user-group.github.io/post/activityinfoscript/