This R script visualizes and analyzes blood pressure data using ggplot2
, dplyr
, readxl
, and ggrepel
. It imports an Excel file containing timestamps, systolic and diastolic pressure, and heart rate (pulse) readings. The timestamps are converted to POSIXct format for accurate time plotting.
The script generates a line plot, where systolic, diastolic pressure, and pulse are displayed over time with distinct colors (red for systolic, blue for diastolic, and grey for pulse). The plot includes a secondary y-axis for heart rate and is annotated with non-overlapping labels using geom_text_repel
to display individual data values.
The plot is further customized with axis labels, a title, a caption, and a dynamic subtitle showing average systolic and diastolic pressure. The mean systolic and diastolic pressures are calculated at the end of the script, rounding the systolic mean to one decimal place for clarity.
- Download of all necessary files
- Install necessary libraries on your local environment
- Run application
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
This script uses the MIT License.