plot.dsobs: Plotting functions for observations of dive trajectories

Description Usage Arguments Examples

View source: R/plot.dsobs.R

Description

Builds a ggplot2 graph.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S3 method for class 'dsobs'
plot(
  x,
  depth.bins,
  stages = NULL,
  errorbars = FALSE,
  underlay = NULL,
  imputed.alpha = 0.3,
  imputed.list = NULL,
  time.as.POSIXct = FALSE,
  ...
)

Arguments

x

dsobs object with record of observed depth bins

depth.bins

n x 2 Matrix that defines the depth bins. The first column defines the depth at the center of each depth bin, and the second column defines the half-width of each bin.

stages

Optional vector of for which dive stage the trajectory was in at each observation

errorbars

If TRUE, then the minimum and maximum depth for each bin will be included in the plot.

underlay

additional ggplot2 layers to place before the main plot layers

imputed.alpha

transparency value used for plotting imputed trajectories, if provided

imputed.list

A list of dsdive objects to be plotted underneath the main dsdive trajectory x. The intent is that imputed.list will contain imputed trajectories.

time.as.POSIXct

if TRUE, will convert plotting times to POSIXct

...

(currently unused) additional plotting parameters

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data('dive.sim')
attach(dive.sim)

# basic plot
pl = plot(x = sim.obs, depth.bins = depth.bins)

# plot with stages overlaid
pl2 = plot(x = sim.obs, depth.bins = depth.bins, stages = sim.obs$stages)

# plot with trajectory underlaid
pl3 = plot(x = sim.obs, depth.bins = depth.bins, imputed.list = sim)

detach(dive.sim)

jmhewitt/dsdive documentation built on May 29, 2020, 5:18 p.m.