This repository supports code used to create tables in the GAP_PRODUCTS Oracle schema. These tables include the master production tables, tables shared with AKFIN, and tables publicly shared on FOSS.
There are some issues with the vignette on the website for AI rock sole size composition example:
The POPULATION_COUNT field should be the height of the distribution plots. Currently it is showing the prevalence of each length bin which is why it has a flat top
LENGTH_MM -9 codes are included which is why the plot dips into the negative
AI rock sole unid. records are not included
Solution:
Update the SQL portion of the vignette with the code below. I don't know how to do the ggplot2 part of the example so I will pass that over to @EmilyMarkowitz-NOAA when she gets around to it.
-- 7.0.7 AI rock sole size composition
SELECT
YEAR,
LENGTH_MM / 10 AS LENGTH_CM,
SUM(POPULATION_COUNT) AS POPULATION_COUNT
FROM GAP_PRODUCTS.AKFIN_SIZECOMP
-- 99904 is the AREA_ID that codes for the whole AI survey region
WHERE AREA_ID = 99904
-- including northern rock sole, southern rock sole, and rock sole unid.
AND SPECIES_CODE IN (10260, 10261, 10262)
-- remove the -9 LENGTH_MM code
AND LENGTH_MM > 0
-- sum over species_codes and sexes
GROUP BY (YEAR, LENGTH_MM)
I embedded the CI calculations into the SQL call for the POP 7.0.10 example:
-- Select columns for output data
SELECT
SURVEY_DEFINITION_ID,
BIOMASS_MT / 1000 AS BIOMASS_KMT,
(BIOMASS_MT - 2 * SQRT(BIOMASS_VAR)) / 1000 AS BIOMASS_KCI_DW,
(BIOMASS_MT + 2 * SQRT(BIOMASS_VAR)) / 1000 AS BIOMASS_KCI_UP,
YEAR
-- Identify what tables to pull data from
FROM GAP_PRODUCTS.AKFIN_BIOMASS
-- Filter data results
WHERE SPECIES_CODE = 30060
AND SURVEY_DEFINITION_ID = 47
AND AREA_ID = 99903
AND YEAR BETWEEN 1990 AND 2023
There are some issues with the vignette on the website for AI rock sole size composition example:
Solution:
Update the SQL portion of the vignette with the code below. I don't know how to do the ggplot2 part of the example so I will pass that over to @EmilyMarkowitz-NOAA when she gets around to it.
I embedded the CI calculations into the SQL call for the POP 7.0.10 example: