I am creating a representation of a hospital observation chart in ggplot as part of a project.
I am having some difficulty identifying how to plot a vertical geom_line between the systolic blood pressure and diastolic blood pressure values when the data is held in one column. This is a standard way to represent blood pressure in written notation.
I have plotted the points as symbols in a ggplot using geom_point I now need to link the blood pressure values within each time point.
My ggplot code is as follows:
obschart <- obs %>% ggplot() +
geom_point(aes(x=clinical_event_end_date_time, y=value, shape=point_shape))+
ylab(label = "Value") +
xlab(label = "Date / Time of observation")
My data is:
clinical_event,value,clinical_event_end_date_time,point_shape
Diastolic Blood Pressure,71,02/01/2019 02:24,triangle down
Diastolic Blood Pressure,76,02/01/2019 04:22,triangle down
GCS Total,14,02/01/2019 02:24,square plus
GCS Total,14,02/01/2019 03:42,square plus
GCS Total,15,02/01/2019 04:22,square plus
Heart Rate Monitored,48,02/01/2019 02:24,circle filled
Heart Rate Monitored,56,02/01/2019 03:42,circle filled
Heart Rate Monitored,62,02/01/2019 04:22,circle filled
NEWS Total,2,02/01/2019 04:22,square cross
NEWS Total,4,02/01/2019 02:24,square cross
Peripheral Pulse Rate,48,02/01/2019 02:24,circle filled
Peripheral Pulse Rate,56,02/01/2019 03:42,circle filled
Peripheral Pulse Rate,62,02/01/2019 04:22,circle filled
Respiratory Rate,16,02/01/2019 04:22,cross
Respiratory Rate,17,02/01/2019 03:42,cross
Respiratory Rate,18,02/01/2019 02:24,cross
SpO2,95,02/01/2019 02:24,circle cross
SpO2,95,02/01/2019 04:22,circle cross
SpO2,96,02/01/2019 03:42,circle cross
Systolic Blood Pressure,126,02/01/2019 02:24,triangle
Systolic Blood Pressure,133,02/01/2019 04:22,triangle
The expected output would be a vertical line between the Systolic and Diastolic blood pressure values at each time point.
I have been unable to identify how to select systolic for y and diastolic for yend.