Introduction

This study analyzes the distribution of monkey pox cases in Nigeria by integrating case data with geographic coordinates. Using static and interactive maps, I visualized the spread of monkey pox to identify high-prevalence areas and support targeted public health interventions.

Code

# Load this libraries
library(readxl)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(sf)
## Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.3.1; sf_use_s2() is TRUE
library(ggplot2)
library(leaflet)

Import data sets

monkeypox_data <-read_excel("C:/Users/user/Desktop/hospital/Monkey_Pox_Converted.xlsx")
Nigeria_log <- read_excel("C:/Users/user/Desktop/hospital/Nigeria_States_Lat_Long.xlsx")
head(monkeypox_data)
## # A tibble: 6 × 10
##   State     `2017` `2018` `2019` `2020` `2021` `2022` `2023` `2024` Total
##   <chr>      <dbl>  <dbl>  <dbl>  <dbl>  <dbl>  <dbl>  <dbl>  <dbl> <dbl>
## 1 Abia           1      2      0      0      0     58      6      1    68
## 2 Adamawa        0      0      0      0      0     16      0      0    16
## 3 Akwa Ibom      6      0      1      0      0     12      4      4    27
## 4 Anambra        0      1      1      0      0     25      0      2    29
## 5 Bauchi         0      0      0      0      0      1      0      0     1
## 6 Bayelsa       19     11      7      0      6     45      2      5    15
head(Nigeria_log)
## # A tibble: 6 × 3
##   State     Latitude Longitude
##   <chr>        <dbl>     <dbl>
## 1 Abia          5.45      7.52
## 2 Adamawa       9.33     12.4 
## 3 Akwa Ibom     5.01      7.85
## 4 Anambra       6.22      7.07
## 5 Bauchi       10.8      10.0 
## 6 Bayelsa       4.94      6.07

Merge the data sets

#merge the dataset by "State"
Monkeypox_data2 <- merge(Nigeria_log,monkeypox_data, by = "State")
View(Monkeypox_data2)

Convert to Spatial

#Convert monkeypox_data2 to a spatial object
Monkeypox_SF<- st_as_sf(Monkeypox_data2, coords = c("Longitude", "Latitude"), crs =4326)

Static Map Visualization

#Plot a static map with ggplot2
Monkeypox_SF <- Monkeypox_SF %>%
  mutate(x = st_coordinates(.)[,1],
         y = st_coordinates(.)[,2])

ggplot(Monkeypox_SF) +
  geom_sf() +
  geom_text(aes(x = x, y = y, label = State), size = 3, nudge_y = 0.2, check_overlap = TRUE) +
  theme_minimal() +
  labs(title = "Monkeypox Cases in Nigerian States",
       caption = "Data source: [NCDC]")

Interactive Map Visualization

This is to know the number of cases in NIGERIA since 2017 till 18th August 2024

Monkeypox_total <- Monkeypox_SF %>%
  mutate(Total = as.numeric(Total)) %>%
  mutate(Total = if_else(is.na(Total), 0, Total))

# pick color palette
pal <- colorNumeric(palette = "YlOrRd", domain = Monkeypox_total$Total)

# Create leaflet map with clustering
leaflet(Monkeypox_total) %>%
  addTiles() %>%
  addMarkers(
    lng = ~st_coordinates(geometry)[,1], lat = ~st_coordinates(geometry)[,2],
    popup = ~paste("State:", State, "<br/>Total Cases:", Total),
    clusterOptions = markerClusterOptions()
  ) %>%
  addLegend(pal = pal, values = Monkeypox_total$Total, title = "Total Cases",
            position = "bottomright")

Conclusion

The geo spatial analysis of monkey pox cases across Nigerian states has illuminated the areas with the highest and lowest case numbers. The interactive and static maps reveal clear patterns of distribution that highlight regions with significant disease prevalence. The maps demonstrate that certain states are more affected, which can aid prioritize areas for intervention and resource allocation.