library(HistData)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.2     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.3     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(openintro)
## Loading required package: airports
## Loading required package: cherryblossom
## Loading required package: usdata
library(ggrepel)
Final_Cholera <- data(Cholera)
#esquisse::esquisser(data)

Description

In 1852, William Farr, published a report of the Registrar-General on mortality due to cholera in England in the years 1848-1849, during which there was a large epidemic throughout the country. Farr initially believed that cholera arose from bad air (“miasma”) associated with low elevation above the River Thames. John Snow (1855) later showed that the disease was principally spread by contaminated water. This data set comes from a paper by Brigham et al. (2003) that analyses some tables from Farr’s report to examine the prevalence of death from cholera in the districts of London in relation to the available predictors from Farr’s table. ### Format A data frame with 38 observations on the following 15 variables. district name of the district in London, a character vector cholera_drate deaths from cholera in 1849 per 10,000 inhabitants, a numeric vector cholera_deaths number of deaths registered from cholera in 1849, a numeric vector popn population, in the middle of 1849, a numeric vector elevation elevation, in feet above the high water mark, a numeric vector region a grouping of the London districts, a factor with levels West North Central South Kent water water supply region, a factor with levels Battersea New River Kew; see Details annual_deaths annual deaths from all causes, 1838-1844, a numeric vector pop_dens population density (persons per acre), a numeric vector persons_house persons per inhabited house, a numeric vector house_valpp average annual value of house, per person (pounds), a numeric vector poor_rate poor rate precept per pound of house value, a numeric vector area district area, a numeric vector houses number of houses, a numeric vector house_val total house values, a numeric vector ### In this dashboard I am wondering what affects the amount of death or the death rate from Cholera in 1848 London?

My first is does the amount of wealth affect the death rate?

The graph shows that wealth does not matter due to how spread and even it is in both the poor and rich sides of the graph.

ggplot(Cholera) +
  aes(
    x = poor_rate,
    y = district,
    fill = region,
    colour = region,
    size = cholera_drate
  ) +
  geom_boxplot() +
  scale_fill_hue(direction = 1) +
  scale_color_hue(direction = 1) +
  labs(
    x = "Poor rate by house value",
    y = "Districts of London",
    fill = "Regions of London",
    color = "Regions of London",
    size = "Cholera death rate by 10,
   000"
  ) +
  theme_minimal()
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

Another question is does the population Density affect the death rate?

The graph shows that Density doesn’t affect the death rate with it being spread out in all the districts.

ggplot(Cholera) +
  aes(
    x = pop_dens,
    y = district,
    fill = region,
    colour = region,
    size = cholera_drate
  ) +
  geom_boxplot() +
  scale_fill_hue(direction = 1) +
  scale_color_hue(direction = 1) +
  labs(
    x = "Population Density of the District/Acre",
    y = "District of London",
    title = "",
    fill = "Regions of London",
    color = "Regions of London",
    size = "Death Rate of Cholera by 10,
   000"
  ) +
  theme_minimal()

So that begs to question of what affects the death rates in London during the Cholera outbreak.

Does what water company that affects each District and Region affect the deaths from Cholera?**

This graph shows that the Districts in what Region of London they are located in and what water company specifically causes the amount of deaths with Battersea being the most deadly due to Cholera spreading by the water.

ggplot(Cholera) +
  aes(
    x = cholera_deaths,
    y = district,
    fill = water,
    colour = water
  ) +
  geom_boxplot() +
  scale_fill_hue(direction = 1) +
  scale_color_hue(direction = 1) +
  theme_minimal() +
  facet_wrap(vars(region)) +
  labs(
    x = "Deaths from Cholera",
    y = "Districts of London",
    fill = "Water Companies of London",
    color = "Water Companies of London"
  ) +
  theme_minimal() +
  theme(axis.text.y = element_text(size = 5),axis.text.x = element_text(size = 8)) +
  facet_wrap(vars(region))

Just like what John Snow found out in his own survey of London as to what caused the deaths by he discovered that most of the deaths were affected by the Broad Street pump. This shows that water is the main way in tracking an see how the deaths and death rate be so high.

data(Snow.deaths)
data(Snow.pumps)
data(Snow.streets)
data(Snow.polygons)
data(Snow.deaths)
# add polygons
SnowMap(polygons=TRUE, main="Snow's Cholera Map with Pump Polygons")

# zoom in a bit, and show density estimate
SnowMap(xlim=c(7.5,16.5), ylim=c(7,16), polygons=TRUE, density=TRUE,
main="Snow's Cholera Map, Annotated")