Skip to contents

Function to calculate relative humidity (%) from temperature (°C) and absolute humidity (g/m^3)

Usage

calcRH_AH(Temp, Abs, P_atm = 1013.25)

Arguments

Temp

Temperature (°Celsius)

Abs

Absolute Humidity (g/m³)

P_atm

Atmospheric pressure = 1013.25 (hPa)

Value

Relative Humidity (0-100%)

References

Buck, A. L. (1981). New equations for computing vapor pressure and enhancement factor. Journal of Applied Meteorology, 20(12), 1527-1532.

See also

calcAH for calculating absolute humidity

calcTemp for calculating temperature

calcRH_DP for calculating relative humidity from dew point

calcDP for calculating dew point

Examples

# Calculate RH for temperature of 20°C and absolute humidity of 8.645471 g/m³
calcRH_AH(20, 8.630534)
#> [1] 50

calcRH_AH(20, calcAH(20, 50))
#> [1] 50

head(mydata) |> dplyr::mutate(Abs = calcAH(Temp, RH), RH2 = calcRH_AH(Temp, Abs))
#> # A tibble: 6 × 7
#>   Site   Sensor Date                 Temp    RH   Abs   RH2
#>   <chr>  <chr>  <dttm>              <dbl> <dbl> <dbl> <dbl>
#> 1 London Room 1 2024-01-01 00:00:00  21.8  36.8  7.05  36.8
#> 2 London Room 1 2024-01-01 00:15:00  21.8  36.7  7.03  36.7
#> 3 London Room 1 2024-01-01 00:29:59  21.8  36.6  7.01  36.6
#> 4 London Room 1 2024-01-01 00:44:59  21.7  36.6  6.97  36.6
#> 5 London Room 1 2024-01-01 00:59:59  21.7  36.5  6.95  36.5
#> 6 London Room 1 2024-01-01 01:14:59  21.7  36.2  6.90  36.2