diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index dfec773..07a8020 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -62,7 +62,7 @@ jobs: while read -r cmd do eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "22.04"))') - name: Install dependencies run: | diff --git a/R/cpue-index-tweedie.R b/R/cpue-index-tweedie.R index 92ed2c4..8287c1c 100644 --- a/R/cpue-index-tweedie.R +++ b/R/cpue-index-tweedie.R @@ -25,6 +25,7 @@ fit_cpue_index_glmmtmb <- function(dat, formula = cpue ~ year_factor, ...) { #' @export #' @rdname fit_cpue_index_glmmtmb predict_cpue_index_tweedie <- function(object, center = FALSE) { + # Following causes NOTE in check() if (class(object) != "glmmTMB") stop("Class of `object` must be glmmTMB.") sdr <- object$sdr yrs <- sort(unique(object$frame$year_factor)) diff --git a/R/gfplot.R b/R/gfplot.R index c33224b..274c4ed 100644 --- a/R/gfplot.R +++ b/R/gfplot.R @@ -46,6 +46,36 @@ if (getRversion() >= "2.15.1") { "landed_pcs", "species_common_name", "species_desc", "species_science_name", "trip_start_date", "year", + # binomial_perc: + "uniroot", + + # extract_maturity_perc, extract_maturity_perc_re, fit_mat_ogive, + # mat_par_delta_method, plot_mat_annual_ogives + "family", + + # plot_growth: + "geom_jitter", + + # plot_lengths: + "survey_abbrev2", + + # plot_mat_ogive: + "age_or_length", + + # plot_survey_index: + "geomean", + + # plot_survey_index: + "biomass_scaled", + + # split_catch_by_sex: + "new_weight", "group_name", "group_weight", "est_sample_weight", + "n_fish_sampled", "mean_weight_kg", "group_n", "weighted.mean", + "median_prop_ann", "n_events_sampled", "n_fish_by_surv_yr", + "mean_prop_ann", "mean_ann_weight_kg", "median_prop", "total_ann_samples", + "total_ann_fish", "mean_prop", "total_survey_samples", + "total_survey_fish", "split_catch_type", + # weighting: "month", "freq", "trip_id", "sample_id", "survey_id", "value", "prop", "annual_prop", "quarter", "sum_freq", diff --git a/R/growth.R b/R/growth.R index ec355b3..475c4e6 100644 --- a/R/growth.R +++ b/R/growth.R @@ -149,6 +149,8 @@ fit_vb <- function(dat, } vb_mod_gfplot <- rstan::stan_model(.f) + + # Following causes a NOTE in check() assign("vb_mod_gfplot", vb_mod_gfplot, envir = globalenv()) } diff --git a/R/plot-lengths.R b/R/plot-lengths.R index f15f91b..ab8a062 100644 --- a/R/plot-lengths.R +++ b/R/plot-lengths.R @@ -21,6 +21,8 @@ #' `"F"` and `"M"` for female and male. #' @param survey_cols An optional named character vector of colors for the #' various surveys. +#' @param survey_facets A vector of names to use in the survey formula labels +#' used in the facets. If `NULL`, the survey abbreviations will be used. #' @param alpha Transparency for the fill color in the histograms. #' @param bin_size Bin size. Should match the bin size used with the `tidy_*()` #' function. diff --git a/R/tidy-cpue-index.R b/R/tidy-cpue-index.R index ac70991..247153b 100644 --- a/R/tidy-cpue-index.R +++ b/R/tidy-cpue-index.R @@ -35,6 +35,8 @@ #' @param lat_bin_quantiles Quantiles for the latitude bands. Values above and #' below these quantiles will be discarded. #' @param gear One or more gear types as a character vector. +#' @param return_raw_data If `TRUE`, return a data.frame containing the raw +#' data #' #' @export #' @@ -61,7 +63,8 @@ tidy_cpue_index <- function(dat, species_common, depth_bin_quantiles = c(0.001, 0.999), min_bin_prop = 0.001, lat_bin_quantiles = c(0, 1), - gear = "bottom trawl", return_raw_data = FALSE) { + gear = "bottom trawl", + return_raw_data = FALSE) { pbs_areas <- gfplot::pbs_areas[grep( area_grep_pattern, gfplot::pbs_areas$major_stat_area_description diff --git a/man/plot_lengths.Rd b/man/plot_lengths.Rd index 9962949..1a3924b 100644 --- a/man/plot_lengths.Rd +++ b/man/plot_lengths.Rd @@ -41,6 +41,9 @@ various surveys.} \item{alpha}{Transparency for the fill color in the histograms.} +\item{survey_facets}{A vector of names to use in the survey formula labels +used in the facets. If \code{NULL}, the survey abbreviations will be used.} + \item{bin_size}{Bin size. Should match the bin size used with the \verb{tidy_*()} function.} diff --git a/man/tidy_cpue_index.Rd b/man/tidy_cpue_index.Rd index 8eb5836..85b7a6d 100644 --- a/man/tidy_cpue_index.Rd +++ b/man/tidy_cpue_index.Rd @@ -74,6 +74,9 @@ level is less than this value then that factor level will be dropped.} below these quantiles will be discarded.} \item{gear}{One or more gear types as a character vector.} + +\item{return_raw_data}{If \code{TRUE}, return a data.frame containing the raw +data} } \description{ This function determines the qualifying "fleet" for CPUE analyses. It is