plot_dive: Create a dive plot

Description Usage Arguments Value Examples

View source: R/plot_dive.R

Description

plot_dive creates a plot of a single dive in two panels. The left panel zooms in on the dive itself and the right panel is an overview of the entire event. In the left panel, blue points are within the dive and red points are the surrounding records for context. The right panel has two curves. The red one shows the original, pre-calibration points. The green one is the calibrated dive with the surface offset applied. The shaded region delineates the dive itself. In both panels, the dashed blue line indicates the surface noise threshold.

Usage

1
plot_dive(calib_tdr, diveid, surface_thr = 0.1)

Arguments

calib_tdr

data.frame. Use calibrate_tdr.

diveid

integer. Identifier of dive to plot.

surface_thr

numeric. Threshold for surface noise.

Value

gtable with two plots.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Load metadata
metadata_path <- system.file('extdata',
                             'MOC2015PFSHmetadata.csv',
                             package = 'pfsh.dive')
metadata <- readr::read_csv(metadata_path)

# Read CEFAS output
tdr_path <- system.file('extdata',
                         paste0(metadata$TDR_filename[1], '.CSV'),
                         package = 'pfsh.dive')
tdr <- read_cefas(tdr_path,
                  metadata$Deployed[1],
                  metadata$Recovered[1])

# Calibrate TDR data
calib_tdr <- calibrate_tdr(tdr, metadata$DeployID[1])

# Plot a dive
plot_dive(calib_tdr, 4)

mczapanskiy-usgs/pfsh.dive documentation built on May 26, 2019, 5:42 p.m.