Function to calculate air density based on temperature (°C), relative humidity in (%), and atmospheric pressure (hPa).
Arguments
- Temp
Temperature (°Celsius)
- RH
Relative Humidity (0-100%)
- P_atm
Atmospheric pressure = 1013.25 (hPa)
- R_dry
Specific gas constant for dry air = 287.058 (J/(kg·K))
- R_vap
Specific gas constant for water vapor = 461.495 (J/(kg·K))
- ...
Addtional arguments to supply to
calcPws
Examples
calcAD(20, 50)
#> [1] 1.204032
head(mydata) |> dplyr::mutate(AirDensity = calcAD(Temp, RH))
#> # A tibble: 6 × 6
#> Site Sensor Date Temp RH AirDensity
#> <chr> <chr> <dttm> <dbl> <dbl> <dbl>
#> 1 London Room 1 2024-01-01 00:00:00 21.8 36.8 1.20
#> 2 London Room 1 2024-01-01 00:15:00 21.8 36.7 1.20
#> 3 London Room 1 2024-01-01 00:29:59 21.8 36.6 1.20
#> 4 London Room 1 2024-01-01 00:44:59 21.7 36.6 1.20
#> 5 London Room 1 2024-01-01 00:59:59 21.7 36.5 1.20
#> 6 London Room 1 2024-01-01 01:14:59 21.7 36.2 1.20