Learn R Programming

bp (version 1.0.1)

bp_hist: Blood Pressure Histograms

Description

The bp_hist function serves to display the frequencies of the SBP and DBP readings. These histograms are formatted to complement the bp_scatter function.

Usage

bp_hist(data, subj = NULL)

Arguments

data

A processed dataframe resulting from the process_data function that contains the SBP, DBP, SBP_CATEGORY, and DBP_CATEGORY columns.

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.

Value

A list containing three histogram visual graphics corresponding to the SBP / DBP totals, SBP frequency, and DBP frequency.

Examples

Run this code
# NOT RUN {
data("bp_jhs")
data("hypnos_data")
hyp_proc <- process_data(hypnos_data,
                         sbp = "syst",
                         dbp = "DIAST",
                         bp_datetime = "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.",
                         bp_datetime = "DateTime",
                         hr = "pulse.bpm.")
rm(hypnos_data, bp_jhs)

bp_hist(hyp_proc)
bp_hist(jhs_proc)
# }

Run the code above in your browser using DataLab