Learn R Programming

physiology (version 1.2.1)

henderson_hasselbalch: pH by Henderson Hasselbalch equation

Description

Calculate the pH based on bicarbonate and partial pressure of CO2

Usage

henderson_hasselbalch(bicarbonate, pp_co2)

Arguments

bicarbonate

mmol/L

pp_co2

partial pressure of carbon dioxide in mmHg

Examples

Run this code
# NOT RUN {
 bicarbonate <- seq(10, 50, 5)
 pp_co2 <- seq(20, 70, 10)
 bc <- rep(bicarbonate, length(pp_co2))
 pp <- rep(pp_co2, each = length(bicarbonate))
 acidbase <- matrix(henderson_hasselbalch(bc, pp), nrow = 9, ncol = 6)
 rownames(acidbase) <- paste("bicarb", bicarbonate)
 colnames(acidbase) <- paste("PaCO2", pp_co2)
 acidbase
# }

Run the code above in your browser using DataLab