View source: R/pressure_to_volume.R
| pressure_to_volume | R Documentation |
Converts pressure measurements to estimated gas volumes using the ideal gas law.
pressure_to_volume(
pressure,
pressure_unit = c("psi", "kpa"),
headspace_volume,
headspace_unit = c("mL", "L"),
temperature = 39
)
pressure |
Numeric pressure values. |
pressure_unit |
Pressure unit. One of:
|
headspace_volume |
Headspace volume. |
headspace_unit |
Headspace volume unit. One of:
|
temperature |
Incubation temperature in degrees Celsius. |
The function supports pressure measurements in PSI or kPa and headspace volumes in mL or L.
Gas volume is estimated using the ideal gas law:
PV = nRT
where:
P is pressure
V is headspace volume
n is gas moles
R is the gas constant
T is absolute temperature
Estimated gas moles are converted to an equivalent gas volume.
A numeric vector containing estimated gas volumes in mL.
# Convert PSI measurements
pressure_to_volume(
pressure = c(
0.5,
1.0,
1.5
),
pressure_unit = "psi",
headspace_volume = 60,
headspace_unit = "mL",
temperature = 39
)
# Convert kPa measurements
pressure_to_volume(
pressure = c(
5,
10,
15
),
pressure_unit = "kpa",
headspace_volume = 0.06,
headspace_unit = "L",
temperature = 39
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.