bp_scatter {bp}R Documentation

Blood Pressure Stage Scatter Plot

Description

Display all SBP and DBP readings on a scatterplot with deliniation of BP according to the 8 mutually exclusive levels of Hypertension as in Lee et al (2020) (the default), or the levels set by the American Heart Association (AHA).

Usage

bp_scatter(
  data,
  plot_type = c("stages2020", "AHA"),
  subj = NULL,
  group_var = NULL,
  wrap_var = NULL,
  inc_crisis = TRUE,
  inc_low = TRUE
)

Arguments

data

A processed dataframe resulting from the process_data function that contains the SBP, and DBP columns, as well as (potentially) other information that can be used for grouping.

plot_type

String corresponding to the particular type of plot to be displayed. Default plot ("stages2020") sets the BP stages according to Lee et al (2020) with 8 mutually exclusive categories. Two additional categories, "Low" or "Crisis", can be determined through the inc_low or inc_crisis function arguments, respectively. Setting plot_type = "AHA" will use the stages according to the guidelines set forth by the American Heart Association (reference: https://www.heart.org/en/health-topics/high-blood-pressure/understanding-blood-pressure-readings)

subj

Optional argument. Allows the user to specify and subset specific subjects from the ID column of the supplied data set. The subj argument can be a single value or a vector of elements. The input type should be character, but the function will comply with integers so long as they are all present in the ID column of the data.

group_var

A categorical column of the input data set that the individual points are to be grouped / separated by for a given plot. Cannot contain more than 10 levels (to avoid overcrowding the plot). This is different from the wrap_var argument which segments plots by category. The default value is NULL (no grouping).

wrap_var

A categorical column of the input data set that the plots are to be segmented by. If there are multiple levels such as time of day, or visit number, the output will include a matrix with each plot corresponding to an individual level. This differs from the group_var argument which separates data within the same plot. The default value is NULL (no wrapping).

inc_crisis

A TRUE / FALSE indicator of whether or not to include the "Crisis" (Hypertensive) category to the scatter plot. This is only activated in conjunction with "stages2020" plot type, and if TRUE is defined as SBP > 180 or DBP > 120. If FALSE, those values are displayed as either "ISH - S2", "S2" or "IDH - S2" stages (see details). This argument is ignored with plot type "AHA", where the "Crisis" stage (SBP > 180 or DBP > 120) is always displayed.

inc_low

A TRUE / FALSE indicator of whether or not to include the "Low" (Hypotension) category to the scatter plot. This is only activated in conjunction with "stages2020" plot type, and if TRUE is defined as SBP < 100 and DBP > 60. If FALSE, those values are displayed as "Normal". This argument is ignored with plot type "AHA", where the "Low" stage (SBP < 100 and DBP < 60) is always displayed.

Details

There are eight total stages according to Lee et al (2020) with the options to include two additional categories for "Low" (Hypotension) and Hypertensive "Crisis". The categories are as follows:

Value

A scatter plot graphic using the ggplot2 package overlaying each reading (represented as points) onto a background that contains each stage

References

Lee H, Yano Y, Cho SMJ, Park JH, Park S, Lloyd-Jones DM, Kim HC. Cardiovascular risk of isolated systolic or diastolic hypertension in young adults. Circulation. 2020; 141:1778–1786. doi: 10.1161/CIRCULATIONAHA.119.044838

Unger, T., Borghi, C., Charchar, F., Khan, N. A., Poulter, N. R., Prabhakaran, D., ... & Schutte, A. E. (2020). 2020 International Society of Hypertension global hypertension practice guidelines. Hypertension, 75(6), 1334-1357. doi: 10.1161/HYPERTENSIONAHA.120.15026

Examples

data("bp_jhs")
data("bp_hypnos")
data("bp_ghana")
hypnos_proc <- process_data(bp_hypnos,
                         bp_type = 'abpm',
                         sbp = "syst",
                         dbp = "DIAST",
                         date_time = "date.time",
                         id = "id",
                         wake = "wake",
                         visit = "visit",
                         hr = "hr",
                         map = "map",
                         rpp = "rpp",
                         pp = "pp",
                         ToD_int = c(5, 13, 18, 23))

jhs_proc <- process_data(bp_jhs,
                         sbp = "Sys.mmHg.",
                         dbp = "Dias.mmHg.",
                         date_time = "DateTime",
                         hr = "pulse.bpm.")
rm(bp_hypnos, bp_jhs)

# HYPNOS Data
bp_scatter(hypnos_proc,
           inc_crisis = TRUE,
           inc_low = TRUE,
           group_var = "wake",
           wrap_var = "day_of_week")

# JHS Data
bp_scatter(jhs_proc,
           plot_type = "AHA",
           group_var = "time_of_day")

# Ghana Data Set
#(Note that column names are of proper naming convention so no processing needed)
bp_scatter(bp::bp_ghana, inc_crisis = TRUE, inc_low = FALSE, group_var = "TIME_ELAPSED")

[Package bp version 2.1.0 Index]