Skip to contents

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

Specific humidity is the ratio of the mass of water vapor to the mass of air.

Usage

calcSH(Temp, RH, P_atm = 1013.25, ...)

Arguments

Temp

Temperature (°Celsius)

RH

Relative Humidity (0-100%)

P_atm

Atmospheric pressure = 1013.25 (hPa)

...

Additional arguments to supply to calcPws

Value

SH Specific Humidity (g/kg)

References

Wallace, J.M. and Hobbs, P.V. (2006). Atmospheric Science: An Introductory Survey. Academic Press, 2nd edition.

See also

calcAD for calculating air density

calcAH for calculating absolute humidity

calcPw for calculating water vapour pressure

calcPws for calculating water vapour saturation pressure

Examples

calcSH(20, 50)
#> [1] 7.168026

head(mydata) |> dplyr::mutate(SpecificHumidity = calcSH(Temp, RH))
#> # A tibble: 6 × 6
#>   Site   Sensor Date                 Temp    RH SpecificHumidity
#>   <chr>  <chr>  <dttm>              <dbl> <dbl>            <dbl>
#> 1 London Room 1 2024-01-01 00:00:00  21.8  36.8             5.89
#> 2 London Room 1 2024-01-01 00:15:00  21.8  36.7             5.88
#> 3 London Room 1 2024-01-01 00:29:59  21.8  36.6             5.86
#> 4 London Room 1 2024-01-01 00:44:59  21.7  36.6             5.83
#> 5 London Room 1 2024-01-01 00:59:59  21.7  36.5             5.81
#> 6 London Room 1 2024-01-01 01:14:59  21.7  36.2             5.76