| Title: | Calculate Water Vapor Measures from Temperature and Dew Point |
|---|---|
| Description: | Vapor pressure, relative humidity, absolute humidity, specific humidity, and mixing ratio are commonly used water vapor measures in meteorology. This R package provides functions for calculating saturation vapor pressure (hPa), partial water vapor pressure (Pa), relative humidity (%), absolute humidity (kg/m^3), specific humidity (kg/kg), and mixing ratio (kg/kg) from temperature (K) and dew point (K). Conversion functions between humidity measures are also provided. |
| Authors: | Jun Cai [aut, cre] (ORCID: <https://orcid.org/0000-0001-9495-1226>) |
| Maintainer: | Jun Cai <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.6 |
| Built: | 2026-05-17 14:56:26 UTC |
| Source: | https://github.com/caijun/humidity |
calculate absolute humidity based on partial water vapor pressure at temperature
AH(e, t, isK = TRUE)AH(e, t, isK = TRUE)
e |
partial water vapor pressure in Pascal (Pa) |
t |
temperature in Kelvin (K) or in degree Celsius (°C) |
isK |
logical indicator whether temperature is in Kelvin (K). The default value is TRUE. |
numeric absolute humidity ()
Jun Cai ([email protected]), Young Research Fellow at the School of Public Health, Fudan University
t <- 273.15 Es <- SVP(t) e <- WVP2(70, Es) AH(e, t)t <- 273.15 Es <- SVP(t) e <- WVP2(70, Es) AH(e, t)
convert temperature in degree Celsius (°C) into Kelvin (K)
C2K(C)C2K(C)
C |
temperature in degree Celsius (°C) |
numeric temperature in Kelvin (K)
Jun Cai ([email protected]), Young Research Fellow at the School of Public Health, Fudan University
K2C.
T0 # zero degrees Celsius in Kelvin (K) C2K(T0)T0 # zero degrees Celsius in Kelvin (K) C2K(T0)
is the saturation vapor pressure at 0 degrees Celsius ().
Es.T0Es.T0
A dataset containing airborne virus particles of influenza A for viable survival in the dark at controlled temperature and relative humidity for 1 hour after spraying.
ivsivs
A data frame with 11 rows and 3 variables:
T: temperature in degree Celsius (7.5–32.0)
RH: relative humidity in percentage (20–82)
PV: percentage of viable virus (6.6–78.0)
Harper, G. J. (1961). Airborne micro-organisms: survival tests with four viruses. Journal of Hygiene, 59(04), 479-486.
A dataset containing aerosol transmission efficiency of influenza A virus from four infected guinea pigs to four exposed guinea pigs under conditions of controlled temperature and relative humidity.
ivtivt
A data frame with 24 rows and 4 variables:
T: temperature in degree Celsius (5–30)
RH: relative humidity in percentage (20–80)
PT: transmission efficiency in percentage (0–100)
source: data source
Lowen, A. C., Mubareka, S., Steel, J., & Palese, P. (2007). Influenza virus transmission is dependent on relative humidity and temperature. PLoS pathogens, 3(10), e151.
Lowen, A. C., Steel, J., Mubareka, S., & Palese, P. (2008). High temperature (30℃) blocks aerosol but not contact transmission of influenza virus. Journal of virology, 82(11), 5650-5652.
convert temperature in Kelvin (K) into degree Celsius (°C)
K2C(K)K2C(K)
K |
temperature in Kelvin (K) |
numeric temperature in degree Celsius (°C)
Jun Cai ([email protected]), Young Research Fellow at the School of Public Health, Fudan University
C2K.
K2C(0)K2C(0)
calculate mixing ratio based on specific humidity
MR(q)MR(q)
q |
specific humidity |
numeric mixing ratio ()
Jun Cai ([email protected]), Young Research Fellow at the School of Public Health, Fudan University
SH.
t <- 273.15 Es <- SVP(t) e <- WVP2(70, Es) q <- SH(e, p = 101325) MR(q)t <- 273.15 Es <- SVP(t) e <- WVP2(70, Es) q <- SH(e, p = 101325) MR(q)
calculate relative humidity based on temperature and dew point
RH(t, Td, isK = TRUE)RH(t, Td, isK = TRUE)
t |
temperature in Kelvin (K) or in degree Celsius (°C) |
Td |
dew point in Kelvin (K) or in degree Celsius (°C) |
isK |
logical indicator whether temperature is in Kelvin (K). The default value is TRUE. |
numeric relative humidity in %.
Jun Cai ([email protected]), Young Research Fellow at the School of Public Health, Fudan University
RH(30, 15, isK = FALSE)RH(30, 15, isK = FALSE)
Specific gas constant of water vapor , where is the molar gas constant and is the molecular weight of water vapor.
RwRw
calculate specific humidity based on partial water vapor pressure under given atmospheric pressure
SH(e, p = 101325)SH(e, p = 101325)
e |
partial water vapor pressure in Pascal (Pa) |
p |
atmospheric pressure in Pascal (Pa). The default is standard atmospheric pressure of 101325Pa. |
numeric specific humidity ()
Jun Cai ([email protected]), Young Research Fellow at the School of Public Health, Fudan University
t <- 273.15 Es <- SVP(t) e <- WVP2(70, Es) SH(e, p = 101325)t <- 273.15 Es <- SVP(t) e <- WVP2(70, Es) SH(e, p = 101325)
Climate models usually provide specific humidity only; however, relative humidity is used to compute heat index that is really useful for health impacts studies. This function converts specific humidity into relative humidity at temperature and under atmospheric pressure .
SH2RH(q, t, p = 101325, isK = TRUE)SH2RH(q, t, p = 101325, isK = TRUE)
q |
specific humidity |
t |
temperature in Kelvin (K) or in degree Celsius (°C) |
p |
atmospheric pressure in Pascal (Pa). The default is standard atmospheric pressure of 101325Pa. |
isK |
logical indicator whether temperature is in Kelvin (K). The default value is TRUE. |
numeric relative humidity in %.
Jun Cai ([email protected]), Young Research Fellow at the School of Public Health, Fudan University
SH2RH(0.005867353, 22.25, p = 101325, isK = FALSE)SH2RH(0.005867353, 22.25, p = 101325, isK = FALSE)
calculate saturation vapor pressure at temperature , using the Clausius-Clapeyron equation or the Murray equation.
SVP(t, isK = TRUE, formula = c("Clausius-Clapeyron", "Murray"))SVP(t, isK = TRUE, formula = c("Clausius-Clapeyron", "Murray"))
t |
temperature in Kelvin (K) or in degree Celsius (°C) |
isK |
logical indicator whether temperature is in Kelvin (K). The default value is TRUE. |
formula |
the formula is used for calculating saturation vapor pressure. By default the Clausius-Clapeyron equation is used. |
numeric saturation vapor pressure in hectopascal (hPa) or millibar (mb)
Jun Cai ([email protected]), Young Research Fellow at the School of Public Health, Fudan University
SVP(273.15)SVP(273.15)
calculate saturation vapor pressure at temperature , using the Clausius-Clapeyron equation.
SVP.ClaCla(t)SVP.ClaCla(t)
t |
temperature in Kelvin (K) |
numeric saturation vapor pressure in hectopascal (hPa) or millibar (mb)
Jun Cai ([email protected]), Young Research Fellow at the School of Public Health, Fudan University
Shaman, J., & Kohn, M. (2009). Absolute humidity modulates influenza survival, transmission, and seasonality. Proceedings of the National Academy of Sciences, 106(9), 3243-3248.
Wallace, J. M., & Hobbs, P. V. (2006). Atmospheric science: an introductory survey (Vol. 92). Academic press.
T0 # zero degrees Celsius in Kelvin (K) SVP.ClaCla(T0)T0 # zero degrees Celsius in Kelvin (K) SVP.ClaCla(T0)
calculate saturation vapor pressure at temperature , per the equation proposed by Murray (1967).
SVP.Murray(t)SVP.Murray(t)
t |
temperature in Kelvin (K) |
numeric saturation vapor pressure in hectopascal (hPa) or millibar (mb)
Jun Cai ([email protected]), Young Research Fellow at the School of Public Health, Fudan University
Murray, F. W. (1967). On the Computation of Saturation Vapor Pressure. Journal of Applied Meteorology, 6(1), 203-204.
T0 # zero degrees Celsius in Kelvin (K) SVP.Murray(T0)T0 # zero degrees Celsius in Kelvin (K) SVP.Murray(T0)
Temperature corresponding to 0 degrees Celsius on the Kelvin scale.
T0T0
calculate partial water vapor pressure based on dew point
WVP1(Td, isK = TRUE)WVP1(Td, isK = TRUE)
Td |
dew point in Kelvin (K) or in degree Celsius (°C) |
isK |
logical indicator whether temperature is in Kelvin (K). The default value is TRUE. |
numeric partial vapor pressure in hectopascal (hPa) or millibar (mb)
Jun Cai ([email protected]), Young Research Fellow at the School of Public Health, Fudan University
T0 # zero degrees Celsius in Kelvin (K) WVP1(T0)T0 # zero degrees Celsius in Kelvin (K) WVP1(T0)
calculate partial water vapor pressure based on relative humdity and saturation water vapor pressure at temperature
WVP2(psi, Es)WVP2(psi, Es)
psi |
relative humidity |
Es |
saturation vapor pressure |
numeric partial water vapor pressure in Pascal (Pa)
Jun Cai ([email protected]), Young Research Fellow at the School of Public Health, Fudan University
Es <- SVP(273.15) WVP2(70, Es)Es <- SVP(273.15) WVP2(70, Es)