Skip to content

Commit

Permalink
Merge pull request #6 from afsc-gap-products/incorporating_gapindex_3…
Browse files Browse the repository at this point in the history
…_0_0

updating with gapindex 3.0.0
  • Loading branch information
sean-rohan-NOAA authored Nov 26, 2024
2 parents 7c44fe3 + 86441dc commit 87eb1d2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: esrindex
Type: Package
Title: Abundance index products for Alaska ESRs
Version: 1.0.0
Date: 2024-11-08
Version: 1.0.1
Date: 2024-11-25
Authors@R: c(person("Sean", "Rohan", email = "sean.rohan@noaa.gov", role = c("aut", "cre")),
person("Thaddaeus", "Buser", email = "thaddaeus.buser@noaa.gov", role = "ctb"),
person("Christina", "Conrath", email = "christina.conrath@noaa.gov", role = "ctb"),
Expand Down
10 changes: 9 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
esrindex 1.0.1 (November 25, 2024)
----------------------------------------------------------------

BUG FIX

- Update get_group_data() to use gapindex 3.0.0 syntax.


esrindex 1.0.0 (November 8, 2024) - First production release
----------------------------------------------------------------

Expand Down Expand Up @@ -74,4 +82,4 @@ esrindex 2024.06.20 (June 20, 2024)
----------------------------------------------------------------

Updated sponge and coral groups with the correct SPECIES_CODE
range.
range.
11 changes: 6 additions & 5 deletions R/get_group_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ get_group_data <- function(region,

dat <- try(gapindex::get_data(year_set = min_year:as.numeric(format(Sys.Date(), "%Y")),
survey_set = region,
sql_channel = channel,
channel = channel,
spp_codes = valid_species_codes), silent = TRUE)

# Warn if there was a gapindex error
Expand All @@ -93,14 +93,15 @@ get_group_data <- function(region,

subareas <- dplyr::select(dat$subarea, AREA_ID, AREA_NAME, DESCRIPTION)

cpue <- gapindex::calc_cpue(racebase_tables = dat)
cpue <- gapindex::calc_cpue(gapdata = dat)

if(nrow(cpue) > 0) {

biomass_strata <- gapindex::calc_biomass_stratum(racebase_tables = dat, cpue = cpue)
biomass_strata <- gapindex::calc_biomass_stratum(gapdata = dat,
cpue = cpue)

subarea_biomass <- gapindex::calc_biomass_subarea(racebase_tables = dat,
biomass_strata = biomass_strata)
subarea_biomass <- gapindex::calc_biomass_subarea(gapdata = dat,
biomass_stratum = biomass_strata)

subarea_biomass_summary <- suppressMessages(
dplyr::group_by(subarea_biomass, AREA_ID, SPECIES_CODE) |>
Expand Down
2 changes: 1 addition & 1 deletion chapters/esrindex.bib
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ @misc{esrindex
@misc{
gapindex,
author = {Zack Oyafuso},
title = {{gapindex: Standard AFSC GAP Product Calculations. R package version 2.2.0}},
title = {{gapindex: Standard AFSC GAP Product Calculations. R package version 3.0.0}},
year = {2024},
url = {https://github.com/afsc-gap-products/gapindex}
}
Expand Down

0 comments on commit 87eb1d2

Please sign in to comment.