compile_vemco_data: Formats temperature data from Vemco deployment

View source: R/compile_Vemco_data.R

compile_vemco_dataR Documentation

Formats temperature data from Vemco deployment

Description

This function formats data from a Vemco deployment so it can be compiled with the HOBO and aquaMeasure data.

Usage

compile_vemco_data(
  path.vemco,
  area.name = "",
  depth.vemco,
  deployment.range,
  trim = TRUE,
  export.csv = FALSE
)

Arguments

path.vemco

File path to the Vemco folder. This folder should have one .csv or .xlsx file that was extracted using Vue software. Other file types in the folder will be ignored.

area.name

Area where the sensor was deployed.

depth.vemco

Character string indicating the depth at which the Vemco was deployed, in the format "10m".

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.

export.csv

Logical value indicating whether to export the compiled data as a .csv file. If export.csv = TRUE, the compiled data will not be returned to the global environment. Default is export.csv = FALSE.

Details

The raw Vemco data must be saved in a folder named Vemco in .csv or .xlsx format.

All columns are read in as class character to ensure the timestamp is parsed correctly. Timestamp must be saved in excel as a number or a character in the order "ymd IMS p", "Ymd IMS p", "Ymd HM", "Ymd HMS", "dmY HM", or "dmY HMS".

If there are "Temperature" entries in the Description column, these will be extracted and compiled. If there are no "Temperature" entries, but there are "Average temperature" entries, these will be extracted and compiled. Otherwise, the function will stop with an error message.

Value

Returns a dataframe or exports a spreadsheet with the formatted Vemco data in two columns: the timestamp (in the format "Y-m-d H:M:S") and temperature value (degree celsius, rounded to three decimal places). Metadata at the top of each column indicates the deployment and retrieval dates, the sensor serial number, the depth of the sensor, and the timezone of the timestamp.

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 timestamps and numeric for temperature values). This can be done using the function convert_to_tidydata().

Author(s)

Danielle Dempsey

See Also

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

Examples

# path to "Vemco" folder
path <- system.file("extdata", package = "strings")
# depth at which sensor was deployed
depth <- "15m"
# deployment and retrieval dates
deployment <- data.frame("START" = "2019-05-30", "END" = "2019-10-19")

vemco_data <- compile_vemco_data(path.vemco = path,
depth.vemco = depth,
deployment.range = deployment)

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