Species that comprise the top x

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