compile_all_data: Compiles HOBO, aquaMeasure, and Vemco data from a single...

View source: R/compile_all_data.R

compile_all_dataR Documentation

Compiles HOBO, aquaMeasure, and Vemco data from a single deployment

Description

Compiles HOBO, aquaMeasure, and Vemco data from a single deployment

Usage

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
)

Arguments

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 deployment.range. (Note: four hours are added to the retrieval date to account for AST, e.g., in case the sensor was retrieved after 20:00 AST, which is 00:00 UTC the next day.) Default is trim = TRUE.

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 TRUE, dissolved oxygen will be corrected for salinity (argument Sal must be specified).

If FALSE, no correction factor will be applied. If the sensor did not record dissolved oxygen data, use the default correct.DO = FALSE.

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".

Details

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

Value

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().

Author(s)

Danielle Dempsey

See Also

Other compile: compile_HOBO_data(), compile_aquaMeasure_data(), compile_vemco_data(), read_deployment_log()

Examples

# 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)


Centre-for-Marine-Applied-Research/strings documentation built on Aug. 21, 2023, 8 a.m.