explore_species_composition: Explores species composition based on landings

Description Usage Arguments Value Attention

View source: R/exlpore_species_composition.R

Description

Species that comprise the top x

Usage

1
2
3
4
5
6
7
8
9
explore_species_composition(
  channel,
  landings,
  threshold,
  filename = NULL,
  speciesCodeCN = "NESPP3",
  catchCN = "CATCH",
  ...
)

Arguments

channel

DBI object. Connection object to database

landings

Data frame (n x r). r >= 3. Must have at least three columns (one named YEAR) The other two necessary columns numst contain Species codes and Catch (units)

threshold

Numeric scalar. Determining the fraction of landings to be represented. Eg. threshold = 0.8 would find the fewest number of species (ordered by landings) that comprise 80% of landings.

filename

Character string. Filename of exported figure

speciesCodeCN

Character string. The name of the column in datafraem that contains the Species codes. Default = "NESPP3"

catchCN

Character string. The name of the column that contains the catch. Default = "CATCH"

...

Other arguments passed to ggplot::ggsave

Value

List:

p

ggplot object

data

Tibble (n x 5). Columns: YEAR,NESPP3,LANDINGS,COMNAME,PresenceAbsence

Attention

For this to work, you need an oracle client installed. Tested with Oracle instantClient_12_2 installed Note: if you use 64 bit Rstudio then you need a 64 bit client Note: if you use 32 bit Rstudio then you need a 32 bit client

You'll also need an account set up on the local server


andybeet/indexPPR documentation built on March 18, 2021, 12:33 p.m.