tgt_bp: Creates a set of logical variables which compare blood...

Description Usage Arguments Author(s) Examples

View source: R/tgt_bp.R

Description

The function takes an existing dataframe, which contains variables of both systolic and diastolic observations, and measures these against a set of treatment target levels. The target levels are set as: 130/80, 140/80, 140/90 and 150/90. A separate logical variable is produced for each target, with a TRUE or FALSE value to indicate whether the test value is below the respective target levels. The full set of target variables are appended to the existing dataframe.

Usage

1
tgt_bp(x)

Arguments

x

Dataframe containing a set of blood pressure observations. The created target variables will be appended to this dataframe.

y

Numeric vector of systolic blood pressure values.

z

Numeric vector of diastolic blood pressure values.

Author(s)

Julian Collins

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# systolic bp values
sys <- sample(90:200, 50)

# diastolic bp values
dias <- sample(40:120, 50)

# combine into dataframe [bp pairs may be unrealistic due to randomness]
bp <- tibble::tibble(sys, dias)

# Measure the blood pressure values against the full set of targets, adding logical variables to the dataframe
data <- tgt_bp(bp, sys, dias)

KHP-IDEO/rIDEO documentation built on Aug. 11, 2019, 4:29 p.m.