Skip to content

Commit

Permalink
Fix all NOTEs and ERRORS in check()
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrandin committed Oct 8, 2024
1 parent da8ac14 commit 5989da8
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
1 change: 1 addition & 0 deletions R/cpue-index-tweedie.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
30 changes: 30 additions & 0 deletions R/gfplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions R/growth.R
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down
2 changes: 2 additions & 0 deletions R/plot-lengths.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion R/tidy-cpue-index.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#'
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions man/plot_lengths.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/tidy_cpue_index.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5989da8

Please sign in to comment.