bp_tables {bp}R Documentation

Blood Pressure Tables

Description

Generate a list of pertinent table outputs that detail various information specific to blood pressure.

Usage

bp_tables(
  data,
  bp_type = 0,
  bp_perc_margin = NULL,
  wake_perc_margin = 2,
  subj = NULL
)

Arguments

data

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

bp_type

An indicator of the type of blood pressure data to output based on either 0 (both SBP and DBP), 1 (SBP only), or 2 (DBP only). Must be of type integer.

bp_perc_margin

An optional argument that determines which of the marginal totals to include in the raw count tables expressed as percentages. The argument can take on values either 0 (both SBP and DBP), 1 (SBP only), or 2 (DBP only).

wake_perc_margin

An optional argument that determines which of the marginal totals to include in the tables pertaining to the percentages of awake / asleep readings if applicable (i.e. if the WAKE column is present). The argument can take on values either 0 (both SBP and DBP), 1 (SBP only), or 2 (DBP only).

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 of table outputs for various subsets of the data based on which bp_type is selected (default is bp_type = 0 i.e. both SBP and DBP tables)

Examples

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_tables(jhs_proc)
bp_tables(hyp_proc)


[Package bp version 1.0.1 Index]