| Title: | Visualize Data from Florence Nightingale's Mortality Analysis |
|---|---|
| Description: | An exemplary R package for learning and trying out practices of research software engineering. |
| Authors: | Jan Simson [aut, cre] (ORCID: <https://orcid.org/0000-0002-9406-7761>), Fritjof Jammers [aut] |
| Maintainer: | Jan Simson <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.3.0 |
| Built: | 2026-05-25 06:30:14 UTC |
| Source: | https://github.com/jansim/nightingale |
A dataset containing mortality data from the Crimean War, famously visualized by Florence Nightingale. The data shows the number of deaths from various causes.
mortalitymortality
A data frame with 24 rows and 5 variables:
Date of the record, in YYYY-MM-DD format.
Annual mortality rate per 1000 from preventable or mitigable zymotic diseases.
Annual mortality rate per 1000 from wounds.
Annual mortality rate per 1000 from all other causes.
Total annual mortality rate per 1000 from all causes.
Florence Nightingale's data, as compiled and processed. The raw data is from "Notes on Matters Affecting the Health, Efficiency, and Hospital Administration of the British Army" by Florence Nightingale, 1858. https://wellcomecollection.org/works/jxwtskzc/items?canvas=9 Extracted by Livnah from Datawrapper. https://www.datawrapper.de/blog/recreating-nightingale-rose-chart
This function creates a bar plot visualization of mortality data from the Crimean War, showing deaths per 1000 soldiers per year. The plot includes a vertical line marking when Nightingale's sanitary improvements were implemented in February/March 1855.
show_barplot( mortality_data = mortality, metrics = c("disease", "other", "wounds"), highlight_intervention = TRUE )show_barplot( mortality_data = mortality, metrics = c("disease", "other", "wounds"), highlight_intervention = TRUE )
mortality_data |
A data frame containing mortality data with columns for date and various causes of death. Defaults to the 'mortality' dataset. |
metrics |
A character vector specifying the metrics to include in the visualization. Defaults to c("disease", "other", "wounds"). |
highlight_intervention |
Logical. Whether to include a vertical line marking Nightingale's sanitary improvements. Defaults to TRUE. |
A ggplot2 object representing the bar plot of mortality data.
# Basic bar plot without total column show_barplot() # Bar plot including total mortality show_barplot(metrics = c("disease", "other", "wounds", "total"))# Basic bar plot without total column show_barplot() # Bar plot including total mortality show_barplot(metrics = c("disease", "other", "wounds", "total"))
This function launches a Shiny dashboard that displays the bar plot of mortality data. Users can select the causes of death to display and toggle the vertical line marking Nightingale's improvements.
show_shiny_app(mortality_data = mortality)show_shiny_app(mortality_data = mortality)
mortality_data |
A data frame containing mortality data with columns for date and various causes of death. Defaults to the 'mortality' dataset. |
The dashboard provides an interactive interface for visualizing mortality data from the Crimean War. Users can: - Select specific causes of death to display in the bar plot. - Toggle the visibility of a vertical line that marks the implementation of Nightingale's sanitary improvements in February 1855.
The bar plot is generated using the 'show_barplot()' function, and the data is dynamically filtered based on user input.
show_barplot for the function that generates the bar plot.
if (interactive()) { show_shiny_app() }if (interactive()) { show_shiny_app() }