Learn R Programming

phoenix (version 1.1.1)

map: Mean Arterial Pressure

Description

Estimate mean arterial pressure from systolic and diastolic blood pressures.

Usage

map(sbp, dbp)

Value

a numeric vector

Arguments

sbp

numeric vector, systolic blood pressure measured in mmHg

dbp

numeric vector, diastolic blood pressure measured in mmHg

Details

Mean Arterial Pressure is approximated by: (DBP + (SBP - DBP) / 3) = (2/3) DBP + (1/3) SBP

Examples

Run this code

DF <- expand.grid(sbp = 40:130, dbp = 20:100)
DF$map <- with(DF, map(sbp, dbp))
with(DF, plot(sbp, dbp, col = map))
DF$map[DF$sbp < DF$dbp] <- NA

z <- matrix(DF$map, nrow = length(unique(DF$sbp)), ncol = length(unique(DF$dbp)))

image(
  x = unique(DF$sbp),
  y = unique(DF$dbp),
  z = z,
  col = hcl.colors(100, palette = "RdBu"),
  xlab = "SBP (mmHg)",
  ylab = "DBP (mmHg)",
  main = "Estimated Mean Arterial Pressue"
)
contour(x = unique(DF$sbp), y = unique(DF$dbp), z = z, add = TRUE)

Run the code above in your browser using DataLab