| Title: | Weather Station Data Summarization and Manipulation for HOBO Data Loggers |
|---|---|
| Description: | Processing of CSV files generated by HOBO weather stations and data loggers. The package automatically imports multiple HOBO data records, removes duplicate records, identifies impossible values, subsets user-defined time ranges, and summarizes environmental data. |
| Authors: | Ricardo I. Alcala Briseno [aut, cre], Adam Carson [ctb], Yung-Hsiang Lan [ctb], Ebba Peterson [ctb], Niklaus J. Grunwald [ctb], Jared M. LeBoldus [ctb] |
| Maintainer: | Ricardo I. Alcala Briseno <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.1.0 |
| Built: | 2026-06-07 18:09:36 UTC |
| Source: | https://github.com/leboldus-lab/hobor |
Calculates the difference between HOBO devices under controlled conditions. This additive function calculates the difference among hobo loggers using a base correction to HOBO loggers.
calibrator(list.data, columns = c(2, 7, 12), times, round = 7)calibrator(list.data, columns = c(2, 7, 12), times, round = 7)
list.data |
A list containing the HOBO CSV files. |
columns |
The columns to be used for calibration. |
times |
The times in a vector of dates to be included in the calibration process. |
round |
The number of decimal places to round the results to. |
a data frame with the differences for data correction, to use with corrector
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata/calibration", package = "hoboR") folder=paste0(rep("canopy", 5), 1:5) pathtoread = data = list() for (i in seq_along(folder)){ pathtoread[[i]] <- paste0(path, "/",folder[i]) # Loading all hobo files data[[i]] <- hobinder(as.character(pathtoread[i]), header = TRUE, skip = 0, channels = "ON" ) # channels is a new feature } # Make sure you enter the date & time format with zeros, # for example 08:00 instead of 8:00 for 8am. times <- c("2022-03-22 01:00", "2022-03-22 02:00", "2022-03-22 03:00", "2022-03-22 04:00", "2022-03-22 05:00", "2022-03-22 06:00", "2022-03-22 07:00", "2022-03-22 08:00", "2022-03-22 09:00") variables <- c(3, 8, 13) # Select the weather variables calibrationmeans <- calibrator(data, columns= variables, times = times)path <- system.file("extdata/calibration", package = "hoboR") folder=paste0(rep("canopy", 5), 1:5) pathtoread = data = list() for (i in seq_along(folder)){ pathtoread[[i]] <- paste0(path, "/",folder[i]) # Loading all hobo files data[[i]] <- hobinder(as.character(pathtoread[i]), header = TRUE, skip = 0, channels = "ON" ) # channels is a new feature } # Make sure you enter the date & time format with zeros, # for example 08:00 instead of 8:00 for 8am. times <- c("2022-03-22 01:00", "2022-03-22 02:00", "2022-03-22 03:00", "2022-03-22 04:00", "2022-03-22 05:00", "2022-03-22 06:00", "2022-03-22 07:00", "2022-03-22 08:00", "2022-03-22 09:00") variables <- c(3, 8, 13) # Select the weather variables calibrationmeans <- calibrator(data, columns= variables, times = times)
Additive function to calculate the difference among hobo loggers to calibrate using a base correction to the data
correction(data, w.var = "FULL", calibrate = calibrate)correction(data, w.var = "FULL", calibrate = calibrate)
data |
a list of CVS data containing the hobo |
w.var |
a column to correct the weather variable e.g., Temperature, RH (relative humidity), or FULL, will use the output of calibrator |
calibrate |
a value to correct the weather variable, must be numeric or USEFILE, will use the output of calibrator |
a data frame with the differences for data correction, to use with corrector
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata/calibration", package = "hoboR") folder=paste0(rep("canopy", 5), 1:5) pathtoread = data = list() for (i in seq_along(folder)){ pathtoread[[i]] <- paste0(path, "/",folder[i]) # Loading all hobo files data[[i]] <- hobinder(as.character(pathtoread[i]), header = TRUE, skip = 0, channels = "ON" ) # channels is a new feature } # Double-check you enter the same date format times <- c("2022-03-22 01:00", "2022-03-22 02:00", "2022-03-22 03:00", "2022-03-22 04:00","2022-03-22 05:00", "2022-03-22 06:00", "2022-03-22 07:00", "2022-03-22 08:00","2022-03-22 09:00") variables <- c(3, 8, 13) # Select the weather variables meanvars <- calibrator(data, columns = variables, times = times) calibratedfiles <- correction(data = data, w.var = "FULL", calibrate = meanvars)path <- system.file("extdata/calibration", package = "hoboR") folder=paste0(rep("canopy", 5), 1:5) pathtoread = data = list() for (i in seq_along(folder)){ pathtoread[[i]] <- paste0(path, "/",folder[i]) # Loading all hobo files data[[i]] <- hobinder(as.character(pathtoread[i]), header = TRUE, skip = 0, channels = "ON" ) # channels is a new feature } # Double-check you enter the same date format times <- c("2022-03-22 01:00", "2022-03-22 02:00", "2022-03-22 03:00", "2022-03-22 04:00","2022-03-22 05:00", "2022-03-22 06:00", "2022-03-22 07:00", "2022-03-22 08:00","2022-03-22 09:00") variables <- c(3, 8, 13) # Select the weather variables meanvars <- calibrator(data, columns = variables, times = times) calibratedfiles <- correction(data = data, w.var = "FULL", calibrate = meanvars)
This function calculates the difference among HOBO loggers, finding the variance and using it as a base correction. It's designed to adjust HOBO data based on calibration files and specified thresholds.
correction.test( list.data, calibrationfile, w.var = c(3, 8, 13), times = times, threshold = c(1, 5, 10) )correction.test( list.data, calibrationfile, w.var = c(3, 8, 13), times = times, threshold = c(1, 5, 10) )
list.data |
A list of CSV data frames containing the HOBO data. |
calibrationfile |
A data frame representing the calibration file. |
w.var |
A vector of column indices to be used in the correction. |
times |
A vector of times for which the data is relevant. |
threshold |
A vector of threshold values for passing the correction test. The smaller the value the highest precision. |
A data frame with the differences for data correction, to be used with a corrector.
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata/calibration", package = "hoboR") folder=paste0(rep("canopy", 5), 1:5) pathtoread = data = list() for (i in seq_along(folder)){ pathtoread[[i]] <- paste0(path, "/",folder[i]) # Loading all hobo files data[[i]] <- hobinder(as.character(pathtoread[i]), header = TRUE, skip = 0, channels = "ON" ) # channels is a new feature } # Double-check you enter the same date format times <- c("2022-03-22 01:00", "2022-03-22 02:00", "2022-03-22 03:00", "2022-03-22 04:00","2022-03-22 05:00", "2022-03-22 06:00", "2022-03-22 07:00", "2022-03-22 08:00","2022-03-22 09:00") variables <- c(3, 8, 13) # Select the weather variables meanvars <- calibrator(data, columns = variables, times = times) correction.test(list.data = data, calibrationfile = meanvars, w.var = variables, times = times, threshold = c(1, 5, 10))path <- system.file("extdata/calibration", package = "hoboR") folder=paste0(rep("canopy", 5), 1:5) pathtoread = data = list() for (i in seq_along(folder)){ pathtoread[[i]] <- paste0(path, "/",folder[i]) # Loading all hobo files data[[i]] <- hobinder(as.character(pathtoread[i]), header = TRUE, skip = 0, channels = "ON" ) # channels is a new feature } # Double-check you enter the same date format times <- c("2022-03-22 01:00", "2022-03-22 02:00", "2022-03-22 03:00", "2022-03-22 04:00","2022-03-22 05:00", "2022-03-22 06:00", "2022-03-22 07:00", "2022-03-22 08:00","2022-03-22 09:00") variables <- c(3, 8, 13) # Select the weather variables meanvars <- calibrator(data, columns = variables, times = times) correction.test(list.data = data, calibrationfile = meanvars, w.var = variables, times = times, threshold = c(1, 5, 10))
HOBO software
count_NAs(data, w.var)count_NAs(data, w.var)
data |
dataframe with suspected NA's |
w.var |
weather variables to test |
Returns the numbers of NAs for the impossible values
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleancsv <- hobocleaner(csvfiles) NAdata <- sensorfailures(cleancsv, condition = "<", threshold = c(0, 0), w.var = c("Rain", "Wetness")) count_NAs(NAdata, "Temp")path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleancsv <- hobocleaner(csvfiles) NAdata <- sensorfailures(cleancsv, condition = "<", threshold = c(0, 0), w.var = c("Rain", "Wetness")) count_NAs(NAdata, "Temp")
Two functions that read the original data downloaded from HOBO software adding file names as metadata for each .csv file and cleans the data from duplicates creating a continuous file from all .csv's
hobinder(path, channels = "OFF", ...)hobinder(path, channels = "OFF", ...)
path |
select the path to the directory with the csv files |
channels |
turn on or off additional channels in HOBO data logger, default "OFF" |
... |
arguments to be passed to methods |
large csv file
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") head(csvfiles)path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") head(csvfiles)
Functions that cleans the original data downloaded from the HOBO software, cleans the data and removes duplicates creating a continuous file from all .csv's
hobocleaner(file, format = "ymd", na.rm = TRUE)hobocleaner(file, format = "ymd", na.rm = TRUE)
file |
CSV from |
format |
Select the time format, month, day, and year (mdy), year, month, and day (ymd) or year two digits, month and day (yymd) |
na.rm |
TRUE or FALSE to remove NAs, TRUE is default |
formatted data frame and duplicate values removed
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleancsv <- hobocleaner(csvfiles) head(cleancsv)path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleancsv <- hobocleaner(csvfiles) head(cleancsv)
This function provides a time point for a specified number of days. HOBO software
data |
A data frame with the HOBO data and a |
summariseby |
Provide the interval date to present (e.g., "month") |
by |
Summary function for aggregation (e.g., "mean") |
na.rm |
Logical, whether to remove NAs from the result |
A ggplot object representing the correlation heatmap
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleaned <- hobocleaner(csvfiles, format = "ymd") hobocorrelations(cleaned, summariseby = "month", by = "mean", na.rm = FALSE)path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleaned <- hobocleaner(csvfiles, format = "ymd") hobocorrelations(cleaned, summariseby = "month", by = "mean", na.rm = FALSE)
This function calculates the means for weather data collected by HOBO loggers over a specified date range. It's designed for use with data exported from HOBO software.
hoborange( data, start = "2022-08-04 09:05", end = "2022-10-04 09:05", na.rm = TRUE )hoborange( data, start = "2022-08-04 09:05", end = "2022-10-04 09:05", na.rm = TRUE )
data |
A data frame containing the HOBO data, including a |
start |
The start of the date range in "yyyy-mm-dd HH:MM" format. |
end |
The end of the date range in "yyyy-mm-dd HH:MM" format. |
na.rm |
A logical value indicating whether NA values should be removed before calculation. |
A subset of the original data frame limited to the specified date range.
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleancsv <- hobocleaner(csvfiles) site.ranges <- hoborange(cleancsv, start = "2022-08-04 09:05", end = "2022-10-04 09:05")path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleancsv <- hobocleaner(csvfiles) site.ranges <- hoborange(cleancsv, start = "2022-08-04 09:05", end = "2022-10-04 09:05")
This function calculates hobo weather by minutes HOBO software
hobotime(data, summariseby = "5 mins", na.rm = TRUE, na.action = na.omit)hobotime(data, summariseby = "5 mins", na.rm = TRUE, na.action = na.omit)
data |
a data frame with the hobo data and a |
summariseby |
a time interval in minmutes |
na.rm |
logical vector TRUE or FALSE |
na.action |
na.omit remove rows with NA's, na.pass keeps NA's |
a data frame summarized by minutes
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata", package = "hoboR") data <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleandata <- hobocleaner(data, format = "ymd") # this function needs clean data subset <- hobotime(cleandata, summariseby = "5 mins", na.rm = TRUE) head(subset)path <- system.file("extdata", package = "hoboR") data <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleandata <- hobocleaner(data, format = "ymd") # this function needs clean data subset <- hobotime(cleandata, summariseby = "5 mins", na.rm = TRUE) head(subset)
Functions that gets the mean by date of the cleaned data downloaded from the HOBO software
impossiblevalues(data, showrows = 10, ...)impossiblevalues(data, showrows = 10, ...)
data |
Cleaned hobo data frame from |
showrows |
Number of rows to show for maximum values, default is 10 |
... |
arguments to be passed to methods |
Gives the rows with impossible values
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleancsv <- hobocleaner(csvfiles) impossiblevalues(cleancsv, showrows = 10)path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleancsv <- hobocleaner(csvfiles) impossiblevalues(cleancsv, showrows = 10)
Functions that gets the summary statistics by summarizing by date the cleaned data downloaded from the HOBO software
data |
cleaned hobo data frame from |
summarisedby |
select a time interval 60 min, 24 hours, 1 day |
na.rm |
TRUE or FALSE to remove NAs, TRUE is default |
minmax |
TRUE or FALSE to retain min and max temperatures |
smaller data frame with means and standard deviation
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata", package = "hoboR") data <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleandata <- hobocleaner(data, format = "ymd") # this function needs clean data#needs clean data hobodata <- meanhobo(cleandata, summariseby = "5 mins", na.rm = TRUE, minmax = TRUE)path <- system.file("extdata", package = "hoboR") data <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleandata <- hobocleaner(data, format = "ymd") # this function needs clean data#needs clean data hobodata <- meanhobo(cleandata, summariseby = "5 mins", na.rm = TRUE, minmax = TRUE)
This function calculates incidence and rates for baiting Phytophthora collected on dates for baited and removed leaves HOBO software
sampling.rates(samples, n, round)sampling.rates(samples, n, round)
samples |
a csv with the format |
n |
Mandatory. Specifies the number of replicates of the experiment |
round |
Optional. Specifies the number of decimal places for rounding the output incidence calculated from a csv table designed for baiting Phytophthora |
smaller data frame with incidence and rates
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata/sampling", package = "hoboR") #' samples <- read.csv(paste0(path, "/", "sampling.csv")) samp.rates <- sampling.rates(samples, n = 9, round = 2)path <- system.file("extdata/sampling", package = "hoboR") #' samples <- read.csv(paste0(path, "/", "sampling.csv")) samp.rates <- sampling.rates(samples, n = 9, round = 2)
sensorfailure() function allows you to detect and flag these
anomalous readings, facilitating the cleansing of your dataset by replacing
all out-of-range values with NA's, maintaining the integrity and accuracy of
of your data analysis.HOBO software
sensorfailures( data, condition = ">", threshold = c(34, 8), w.var = c("Temp", "Rain") )sensorfailures( data, condition = ">", threshold = c(34, 8), w.var = c("Temp", "Rain") )
data |
Convert to NA the impossible values from HOBO data frame from |
condition |
The condition for removal, one of (">", "<", "==", ">=", "<=") |
threshold |
Numeric vector specifying the threshold values for removal |
w.var |
weather variables, can be a single or multiple variables |
Returns the data with NAs for the impossible values
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") data <- hobocleaner(csvfiles) sensorfailures(data, condition = ">", threshold = c(50, 3000, 101), w.var = c("Temp", "Rain", "Wetness")) NAdata <- sensorfailures(data, condition = "<", threshold = c(0, 0), w.var = c("Rain", "Wetness"))path <- system.file("extdata", package = "hoboR") csvfiles <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") data <- hobocleaner(csvfiles) sensorfailures(data, condition = ">", threshold = c(50, 3000, 101), w.var = c("Temp", "Rain", "Wetness")) NAdata <- sensorfailures(data, condition = "<", threshold = c(0, 0), w.var = c("Rain", "Wetness"))
Check if the times date are present in the list of HOBO files
testhobolist(data, times)testhobolist(data, times)
data |
a list of CVS data containing hobo data |
times |
a series of times <- c("2022-03-22 01:00", "2022-03-22 02:00", "2022-03-22 03:00") |
a data frame with the total entries and the count of entries present in each data set
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata/calibration", package = "hoboR") folder=paste0(rep("canopy", 5), 1:5) pathtoread = data = list() for (i in seq_along(folder)){ pathtoread[[i]] <- paste0(path, "/",folder[i]) # Loading all hobo files data[[i]] <- hobinder(as.character(pathtoread[i]), header = TRUE, skip = 0, channels = "ON" ) # channels is a new feature } # Make sure you enter the date & time format with zeros, # for example 08:00 instead of 8:00 for 8am. times <- c("2022-03-22 01:00", "2022-03-22 02:00", "2022-03-22 03:00", "2022-03-22 04:00", "2022-03-22 05:00", "2022-03-22 06:00", "2022-03-22 07:00", "2022-03-22 08:00", "2022-03-22 09:00") data <- testhobolist(data, times)path <- system.file("extdata/calibration", package = "hoboR") folder=paste0(rep("canopy", 5), 1:5) pathtoread = data = list() for (i in seq_along(folder)){ pathtoread[[i]] <- paste0(path, "/",folder[i]) # Loading all hobo files data[[i]] <- hobinder(as.character(pathtoread[i]), header = TRUE, skip = 0, channels = "ON" ) # channels is a new feature } # Make sure you enter the date & time format with zeros, # for example 08:00 instead of 8:00 for 8am. times <- c("2022-03-22 01:00", "2022-03-22 02:00", "2022-03-22 03:00", "2022-03-22 04:00", "2022-03-22 05:00", "2022-03-22 06:00", "2022-03-22 07:00", "2022-03-22 08:00", "2022-03-22 09:00") data <- testhobolist(data, times)
This function provides a time point for a specified number of days. HOBO software
timestamp( data, stamp = "yyyy/mm/dd: ss", by = "24 hours", days = 100, na.rm = TRUE, plot = TRUE, var = "Temp" )timestamp( data, stamp = "yyyy/mm/dd: ss", by = "24 hours", days = 100, na.rm = TRUE, plot = TRUE, var = "Temp" )
data |
A data frame with the HOBO data and a |
stamp |
Provide a date |
by |
Provide the interval date to present (e.g., "24 hours") |
days |
Number of days for the interval |
na.rm |
Logical, whether to remove NAs from the result |
plot |
Logical, whether to generate a plot |
var |
Variable to plot (default is "Temp") |
A data frame summarized by minutes
Ricardo I Alcala Briseno, [email protected]
path <- system.file("extdata", package = "hoboR") data <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleandata <- hobocleaner(data, format = "ymd") datastamp <- timestamp(cleandata, stamp ="2022-08-04 12:00", by = "1 hour", days = 60, na.rm = TRUE, plot = TRUE, var = "Temp")path <- system.file("extdata", package = "hoboR") data <- hobinder(path, header = TRUE, skip = 1, channels = "OFF") cleandata <- hobocleaner(data, format = "ymd") datastamp <- timestamp(cleandata, stamp ="2022-08-04 12:00", by = "1 hour", days = 60, na.rm = TRUE, plot = TRUE, var = "Temp")