This function takes raw Meaco sensor data and performs several cleaning and processing steps:
Filters out rows with missing dates
Renames column names for consistency
Converts temperature and relative humidity to numeric
Rounds dates down to the nearest hour
Calculates hourly averages for temperature and relative humidity
Pads the data to ensure hourly intervals using padr package
Filters out unrealistic temperature and humidity values (outside -50°C to 50°C and 0 to 100%RH)
Usage
tidy_Meaco(
mydata,
Site_col = "RECEIVER",
Sensor_col = "TRANSMITTER",
Date_col = "DATE",
Temp_col = "TEMPERATURE",
RH_col = "HUMIDITY"
)
Arguments
- mydata
A data frame containing raw Meaco sensor data with columns RECEIVER, TRANSMITTER, DATE, TEMPERATURE, and HUMIDITY
- Site_col
A string specifying the name of the column in `mydata` that contains location information. Default is "RECEIVER".
- Sensor_col
A string specifying the name of the column in `mydata` that contains sensor information. Default is "TRANSMITTER".
- Date_col
A string specifying the name of the column in `mydata` that contains date information. Default is "DATE".
- Temp_col
A string specifying the name of the column in `mydata` that contains temperature data. Default is "TEMPERATURE".
- RH_col
A string specifying the name of the column in `mydata` that contains relative humidity data. Default is "HUMIDITY".
Examples
if (FALSE) { # \dontrun{
meaco_data <- read.csv("path/to/your/meaco_data.csv")
meaco_tidy <- tidy_Meaco(meaco_data)
} # }