| calcSH | R Documentation |
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
calcSH(Temp, RH, P_atm = 1013.25, B = 621.9907, ...)
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 |
SH Specific Humidity (g/kg)
This function requires the calcMR function to be available in the environment.
Wallace, J.M. and Hobbs, P.V. (2006). Atmospheric Science: An Introductory Survey. Academic Press, 2nd edition.
calcAD for calculating air density
calcAH for calculating absolute humidity
calcPw for calculating water vapour pressure
calcPws for calculating water vapour saturation pressure
# Calculate specific humidity at 20°C (Temp) and 50% relative humidity (RH)
calcSH(20, 50)
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.