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.
Function uses calcMR
Note
This function requires the calcMR
function to be available in the environment.
References
Wallace, J.M. and Hobbs, P.V. (2006). Atmospheric Science: An Introductory Survey. Academic Press, 2nd edition.
Examples
calcSH(20, 50)
#> [1] 0.8789466
# mydata file
filepath <- data_file_path("mydata.xlsx")
mydata <- readxl::read_excel(filepath, sheet = "mydata", n_max = 5)
mydata |> dplyr::mutate(SpecificHumidity = calcSH(Temp, RH))
#> # A tibble: 5 × 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 0.856
#> 2 London Room 1 2024-01-01 00:15:00 21.8 36.7 0.856
#> 3 London Room 1 2024-01-01 00:29:59 21.8 36.6 0.856
#> 4 London Room 1 2024-01-01 00:44:59 21.7 36.6 0.855
#> 5 London Room 1 2024-01-01 00:59:59 21.7 36.5 0.854