create_summary: Create Station Summary Sheet

View source: R/summary.R

create_summaryR Documentation

Create Station Summary Sheet

Description

This function combines hand-entered station metadata with electronically recorded location and environmental data to output a well formatted station summary sheet.

Usage

create_summary(
  summary_input,
  elg_input,
  csv_folder = "output/csv",
  csv_filename = "summary_datasheet.csv",
  force_stations = TRUE,
  cruiseID = NULL,
  add_cruiseID = TRUE,
  magdiff = 60,
  ...
)

Arguments

summary_input

The input datasheet that includes the relevent station and deployment metadata

csv_folder

The directory path to output the csv file. Set to NULL for no csv output.

csv_filename

The csv filename to output the data

force_stations

logical - set to TRUE if you want to force the output to have station data at the nearest elg entry regardless of whether it is a longer time than magdiff from the nearest data row

cruiseID

Optional string specifying cruise ID (i.e. "S301")

magdiff

maximum time difference in seconds between the station time and the nearest elg time. If greater than this value, look to force_station as to whether to return a NA or add a value regardless

...

optional arguments passed to format_csv_output

elg

The cruise elg file (or folder of files) for extracting continuous data from

add_cruise_ID

If cruiseID is set, logical to specify whether cruiseID should be appended to beginning of filenames for csv and odv output

Details

During deployments at SEA, we maintain paper data sheets which recorded station metadata and data from that deployment. These are a vital component for our data accuracy and redundancy.

In creating electronic datasheets for deployments it is desirable to combine hand-entered station metadata (station number, station type, zone description, etc.) with electronically recorded data (location, surface conditions, etc.) to provide an accurate record of the deployment without the need to re-enter hand-recorded values of the electronic data.

To do this, create_summary() takes in an excel sheet with the bare minimum of hand-entered data:

  • Station number

  • Deployment type

  • Deployment date/time in (and out)

  • Zone description (time zone)

create_summary() combines this data with the electronically recorded "event" data which records (amongst other things):

  • Time

  • Location

  • Surface Temperature

  • Surface Salinity

  • etc.

The event data is typically stored in a file with an extension elg. read_elg() deals with reading this data in and formatting it properly.

Once the two data frames are read in to R, they are combined using the UTC time that exists in both data frames.

Value

A tibble containing the combined data frames. If csv_folder is set to a valid output path then a formatted csv file is output also.


benharden27/seaprocess documentation built on June 28, 2023, 7:20 p.m.