View source: R/compile_all_data.R
compile_all_data | R Documentation |
Compiles HOBO, aquaMeasure, and Vemco data from a single deployment
compile_all_data(
path,
area.name = "",
deployment.range,
trim = TRUE,
serial.table.HOBO = NULL,
correct.DO = FALSE,
Sal = NULL,
serial.table.aM = NULL,
depth.vemco = NULL
)
path |
File path to the Hobo, aquaMeasure, and/or Vemco folders. |
area.name |
Area where the sensor string was deployed. |
deployment.range |
A dataframe with two columns. The first column holds the deployment date (a Date object, POSIXct object, or character string in the order year, month, day), and the second column holds the retrieval date (a Date object, POSIXct object, or character string in the order year, month, day). |
trim |
Logical value indicating whether to trim the data to the dates
specified in |
serial.table.HOBO |
A table with the serial number of each HOBO and TidBiT sensor on the string, in the form "HOBO-xxxxxxxx" or "TidbiT-xxxxxxxx" (first column) and corresponding depth at which it was deployed in the form "2m" (second column). |
correct.DO |
Logical value. If If |
Sal |
A single value of salinity (psu), used to calculate the salinity correction factor for dissolved oxygen. |
serial.table.aM |
A table with the serial number of each aquaMeasure on the string, in the form "aquaMeasure-xxxxxx" (first column; note the capital "M") and its corresponding depth in the form "2m" (second column). |
depth.vemco |
Character string indicating the depth at which the Vemco was deployed, in the format "10m". |
Calls compile_HOBO_data()
, compile_aquaMeasure_data()
and compile_vemco_data()
and joins the results into a single wide
dataframe.
HOBO data must be in a folder named Hobo, aquaMeasure data must be in a folder named aquaMeasure, and Vemco data must be in a folder name Vemco. The Hobo, aquaMeasure, and Vemco folders must be in the same folder.
If one type of sensor was not included in the deployment, set the argument
related to that sensor to NULL
(the default). For example, if there
is no aquaMeaure data for the deployment, set serial.table.aM = NULL
Returns a dataframe with the compiled and formatted data. Columns alternate between the timestamp (in the format "Y-m-d H:M:S") and the variable value (rounded to three decimal places). Metadata at the top of each column indicates the deployment and retrieval dates, the sensor serial number, and the variable and depth of the sensor. Each timestamp column shows the timezone as extracted from the sensor.
To include the metadata, all values were converted to class
character
. To manipulate the data, the values must be converted to
the appropriate class (e.g., POSIXct
for the timestamp and
numeric
for variable values). This can be done using the function
convert_to_tidydata()
.
Danielle Dempsey
Other compile:
compile_HOBO_data()
,
compile_aquaMeasure_data()
,
compile_vemco_data()
,
read_deployment_log()
# path to "Hobo", "aquaMeasure", and "Vemco" folders
path <- system.file("extdata", package = "strings")
# Hobo sensor and depth at which it was deployed
serial.table.HOBO <- data.frame("SENSOR" = "HOBO-10755220", "DEPTH" = "2m")
serial.table.aM <- data.frame("SENSOR" = "aquaMeasure-670364", "DEPTH" = "5m")
depth.vemco <- "15m"
# deployment and retrieval dates
deployment <- data.frame("START" = "2019-05-30", "END" = "2019-10-19")
all_data <- compile_all_data(path = path,
serial.table.HOBO = serial.table.HOBO,
serial.table.aM = serial.table.aM,
depth.vemco = depth.vemco,
deployment.range = deployment)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.