mo2_data <- read.csv(system.file('extdata', 'mo2_v_po2.csv', package = 'respirometry'))
calc_alpha(po2 = mo2_data$po2, mo2 = mo2_data$mo2, MR = 1.5) # MR set to 1.5 to capture the
# Pcrit corresponding to some of the lowest MO2 values recorded (something close to SMR).
# extract the alpha0 values that were averaged together
sapply(calc_alpha(po2 = mo2_data$po2, mo2 = mo2_data$mo2,
MR = 1.5, avg_top_n = 3)$alpha_obs, function(i) i[3])
Run the code above in your browser using DataLab