Skip to contents

This function was deprecated in nwfsc version 2.1. Please use plot_proportion() instead.

Usage

PlotPresenceAbsence.fn(
  data,
  dim = c("depth", "lat", "sex"),
  dir = NULL,
  dopng = lifecycle::deprecated(),
  plot_type = c("proportion", "total"),
  depth_min = 50,
  depth_max = NULL,
  depth_bin_width = 25,
  lat_min = 32,
  lat_max = 49,
  lat_bin_width = 1,
  add_range_to_main = TRUE,
  xlab = NULL
)

Arguments

data

Data frame containing data per haul created by pull_catch() or biological data created by pull_bio() where the dim = "sex" must be true for the latter.

dim

Dimension of interest, either "depth", "lat", or "sex".

dir

Directory where output will be saved. The directory where the file should be saved. If dir = NULL no output will be saved.

dopng

Deprecated with nwfscSurvey 2.1 because providing a non-NULL value to dir can serve the same purpose as dopng = TRUE without the potential for errors when dopng = TRUE and dir = NULL. Thus, users no longer have to specify dopng to save the plot as a png.

plot_type

Two options area available "proportion" or "total" where the default, "proportion", plot the proportion by depth/latitude with equal bar widths and the "total" option plot the numbers by depth/latitude were the bar widths in a production of sampling by depth/latitude.

depth_min

Minimum depth (in meters).

depth_max

Maximum depth (in meters). A NULL value will cause the function to automatically set depth_max to the multiple of depth_bin_width beyond the 99.9 percentile of the observations.

depth_bin_width

Width of each depth bin (in meters).

lat_min

Minimum latitute (in decimal degrees).

lat_max

Maximum latitute (in decimal degrees).

lat_bin_width

Width of each latitude bin (in decimal degrees).

add_range_to_main

Add the range of latitude or depth by which the data are filtered.

xlab

Label for x-axis. A NULL value will cause the function to choose either "Depth (m)" or "Latitude (°N)".

Author

Ian G. Taylor and Chantel Wetzel

Examples

if (FALSE) { # \dontrun{
# load WCGBTS data data
data.WCGBTS.ling <- nwfscSurvey::PullCatch.fn(
  Name = "lingcod",
  SurveyName = "NWFSC.Combo"
)
bio.WCGBTS.ling <- nwfscSurvey::PullBio.fn(
  Name = "lingcod",
  SurveyName = "NWFSC.Combo"
)
PlotPresenceAbsence.fn(data = data.WCGBTS.ling, dim = "lat")
PlotPresenceAbsence.fn(data = data.WCGBTS.ling, dim = "depth")
PlotPresenceAbsence.fn(data = bio.WCGBTS.ling, dim = "sex")

# Plot with package data
PlotPresenceAbsence.fn(catch_nwfsc_combo)
} # }