East Africa is still battling its worst locust invasion in decades. Amid the COVID-19 crisis, countries are fighting to stop a new generation of locusts swarms.
# How East Africa is fighting locusts amid coronavirus
East Africa is still battling its worst locust invasion in decades. Amid
the COVID-19 crisis, countries are fighting to stop a new generation of
locusts swarms.
*In this repository, you will find the methodology, data and code behind
the story that came out of this analysis.*
**Read the full article on DW:**
English |
German
**Story by:** Kira
Schacht
# Files
| Name | Content |
| ------------- | --------------------------------------------------------------------------------- |
| `locusts.Rmd` | The main R markdown script. Run in RStudio to reproduce this analysis. |
| `data.RData` | The R Data file containing the imported datasets. Use if csv import doesn’t work. |
| `data/...` | Data files |
# Data sources
- FAO Locust Hub
- FAO Desert Locust Information
Service
- IPC Global Report on Food
Crises 2020,
see table page 214-215
# Methodology
Here is a step-by-step-explanation of the code we used in this analysis.
You can explore it yourself by opening `locusts.Rmd` in RStudio.
## Setup
Load necessary packages and presets
``` r
## install and load needs, if not yet present
# install.packages("needs")
library(needs)
# packages used in this markdown document
needs(tidyverse, lubridate, rgdal, broom)
```
## Read data
For this project, we’ll mainly be using this data from the FAO Locust
Hub. It contains information
on the location and size of loocust groups over time, as well as the
accompanying control operations.
``` r
# Generate file list
file_list = list.files("data",pattern = "geo_[ABHS].*csv", full.names = T)
# Read 4 datasets on locust locationa: Adults, Bands, Hoppers and Swarms, and bind into one dataset
d = lapply(file_list, read.csv, stringsAsFactors = F, na.strings = c(" ", "","NA")) %>%
bind_rows() %>% select(-(22:134))
r …