Learn R Programming

ConSciR (version 0.3.0)

calcHR: Calculate Humidity Ratio

Description

Function to calculate humidity ratio (g/kg) from temperature (°C) and relative humidity (%).

Humidity ratio is the mass of water vapor present in a given volume of air relative to the mass of dry air. Also known as "moisture content".

Function uses calcMR

Usage

calcHR(Temp, RH, P_atm = 1013.25, B = 621.9907, ...)

Value

HR Humidity ratio (g/kg)

Arguments

Temp

Temperature (°Celsius)

RH

Relative Humidity (0-100%)

P_atm

Atmospheric pressure = 1013.25 (hPa)

B

B = 621.9907 g/kg for air

...

Additional arguments to supply to calcPws and calcMR

See Also

calcMR for calculating mixing ratio

calcAD for calculating air density

calcPw for calculating water vapour pressure

calcPws for calculating water vapour saturation pressure

Examples

Run this code
# Humidity ratio at 20°C (Temp) and 50% relative humidity (RH)
calcHR(20, 50)


# mydata file
filepath <- data_file_path("mydata.xlsx")
mydata <- readxl::read_excel(filepath, sheet = "mydata", n_max = 5)

mydata |> dplyr::mutate(HumidityRatio = calcHR(Temp, RH))


Run the code above in your browser using DataLab