explore_species_composition.Rd
Species that comprise the top x
explore_species_composition(
channel,
landings,
threshold,
filename = NULL,
speciesCodeCN = "NESPP3",
catchCN = "CATCH",
...
)
DBI object. Connection object to database
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)
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.
Character string. Filename of exported figure
Character string. The name of the column in datafraem that contains the Species codes. Default = "NESPP3"
Character string. The name of the column that contains the catch. Default = "CATCH"
Other arguments passed to ggplot::ggsave
List:
ggplot object
Tibble (n x 5). Columns: YEAR,NESPP3,LANDINGS,COMNAME,PresenceAbsence
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