View source: R/add_humidity_calcs.R
| add_humidity_calcs | R Documentation |
This function adds several humidity variables to a dataframe with temperature and relative humidity columns. It uses the humidity functions (e.g., calcPws, calcPw).
add_humidity_calcs(mydata, Temp = "Temp", RH = "RH", P_atm = 1013.25, ...)
mydata |
A dataframe containing temperature and relative humidity data. |
Temp |
Character string name of the temperature column (default "Temp"). |
RH |
Character string name of the relative humidity column (default "RH"). |
P_atm |
Atmospheric pressure (hPa), default 1013.25. |
... |
Additional parameters passed to humidity calculation functions. |
The input dataframe augmented with columns for vapor pressure, dew point, absolute humidity, air density, mixing ratio, specific humidity, and enthalpy.
Saturated vapour pressure at given temperature (hPa).
Partial pressure of water vapour present (hPa).
Dew Point, condensation temperature based on RH (°C).
Mass of water vapour per air volume (g/m³).
Moist air density (kg/m³).
Ratio of water vapour to dry air mass (g/kg).
Ratio of water vapour to total air mass (g/kg).
Total enthalpy, h, of air-vapour mixture (kJ/kg).
calcPws for 'Pws'
calcPw for 'Pw'
calcDP for 'DP'
calcAH for 'AH'
calcAD for 'AD'
calcMR for 'MR'
calcSH for 'SH'
calcEnthalpy for 'Enthalpy'
# mydata file
filepath <- data_file_path("mydata.xlsx")
mydata <- readxl::read_excel(filepath, sheet = "mydata", n_max = 5)
mydata |> add_humidity_calcs() |> dplyr::glimpse()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.