View source: R/add_humidity_adjustments.R
| add_humidity_adjustments | R Documentation |
This function processes a dataframe with temperature and relative humidity data and classifies the data into climate control zones. It generates adjusted temperature and humidity values based on thresholds.
add_humidity_adjustments(
mydata,
Temp = "Temp",
RH = "RH",
LowT = 16,
HighT = 25,
LowRH = 40,
HighRH = 60,
P_atm = 1013.25,
...
)
mydata |
A dataframe containing temperature and relative humidity data. |
Temp |
Character string name of the temperature column (default "Temp"). |
RH |
Character string name of the relative humidity column (default "RH"). |
LowT |
Numeric lower temperature threshold (default 16). |
HighT |
Numeric higher temperature threshold (default 25). |
LowRH |
Numeric lower relative humidity threshold (default 40). |
HighRH |
Numeric higher relative humidity threshold (default 60). |
P_atm |
Atmospheric pressure in kPa or hPa (currently unused, default 1013.25). |
... |
Additional arguments passed to internal calculation functions. |
The input dataframe augmented with multiple humidity and temperature adjustment columns.
Absolute Humidity (g/m³): The mass of water vapor per unit volume of air.
Dew Point (°C): The temperature at which air becomes saturated and water vapor condenses.
Categorical variable defining climate control actions based on temperature and RH: 'Heating only', 'Dehum or heating', 'Cooling and hum', etc.
Temperature-relative humidity category: 'Hot', 'Cold', 'Dry', 'Hot and humid', etc.
Temperature zone classification: 'Cold', 'Within', or 'Hot'.
Relative humidity zone classification: 'Dry', 'Within', or 'Humid'.
Temperature difference from specified thresholds (°C), indicating required heating or cooling.
Relative humidity difference from specified thresholds (%), indicating humidification or dehumidification.
Adjusted temperature (°C) after applying temperature and relative humidity correction based on zone.
Adjusted absolute humidity (g/m³).
Adjusted relative humidity (%) reflecting new temperature and absolute humidity.
Differences between adjusted and original temperature, absolute humidity, and relative humidity respectively.
Adjustments based on absolute humidity only (i.e. dehumidification or humidification).
Adjustments based on temperature only (i.e. heating or cooling).
# mydata file
filepath <- data_file_path("mydata.xlsx")
mydata <- readxl::read_excel(filepath, sheet = "mydata", n_max = 5)
mydata |> add_humidity_adjustments() |> dplyr::glimpse()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.