CRAN Submission Release
Robustness and Bug Fixes:
indices_ts.R, index_recr.r, index_spawn.r, index_ts_F.r, index_ts_M.r, and MIW.r to robustly filter NA values, handle NA/NaN in cv_strata calculations, and prevent division by zero in GSAs with a single haul.sex_ratio.r by removing the incorrect square root from the variance formula.Lquant.r before saving files.@return documentation in bubbleplot_RS_by_hauls() to describe the returned list of plots, initialized them to NULL, and returned them correctly.convert_coordinates.r to safely skip NA coordinate records and avoid subscripted assignments error.CRAN Policy Compliance:
tempdir() when wd = NA, ensuring compliance with CRAN's file system policies regarding unauthorized write access. Removed all setwd() calls from internal logic to use absolute paths (file.path()).cat() and print() calls with message() wrapped in if (verbose) checks to ensure a silent default behavior.on.exit(par(oldpar)) and secured working directory restoration where applicable.@return tags (e.g., in hauls_position()) as requested by CRAN reviewers.\donttest{} in aggregate_gsas(), merge_TATB(), merge_TATC(), and merge_TATBTC() to allow automatic testing.Dependency Refinement: Internalized data validation logic based on RoME (v0.2.3) to eliminate external dependencies on non-CRAN repositories.
Bug Fixes and Stability:
continent dataset.class() checks to use inherits() for robust type checking.globalVariables declarations to resolve R CMD check notes.wd and save parameters.GSA (default 10) and wd (default NA) arguments to the IUT() function signature.verbose (default FALSE) argument to the spearman() function signature.BioIndex() to ensure all downstream analysis functions use the correct subset of data and stratification metadata, preventing errors when multiple GSAs are present in input files.indices_ts(), sex_ratio(), MIW(), LFD(), and other core functions. The package now provides clear error messages when the selected depth range does not match the strata defined for the GSA.merge_TATC and merge_TATBTC where decimal coordinates were not correctly assigned, causing failures in spatial aggregation routines (e.g., in bubbleplot_RS_by_hauls).cbind mismatches.BioIndex() in \donttest{} and subset individual mapping examples (bubble_plot_by_haul_indexes() and hauls_position()) to a single year (2016) to ensure swift execution times under CRAN checks.print() calls for ggplot2 objects within analytical functions, relying exclusively on ggsave() for output. This prevents fatal 'figure margins too large' and 'pin' errors when functions are executed via the Shiny app on small active graphics devices.Lquant() that previously attempted to plot to the active screen device by default.on.exit(suppressWarnings(par(oldpar))) now explicitly strips the new attribute from oldpar, preventing 'calling par(new=TRUE) with no plot' warnings after execution.ggplot2::stat_contour warnings (such as 'Zero contours were generated') across spatial plotting functions to maintain a clean console output as per CRAN policies.Added an embedded Shiny application to the package: run_BioIndex_app(). It provides a graphical user interface for running BioIndex analyses directly from the package environment.
Fixes for RBDFIS III
Fixes for RBDFIS III
index_on_grid() modified to auto select the bathymetry contour polygon to be used in the plots.Fixes for RBDFIS III
MIW() for saving and outputing the plots in the correct way in the console.MIW()corrected the functioning of verbose and save parametersbubbleplot_RS_by_hauls() to allow offline plotting: if res = NA, the function now uses an internal dataset med_bathy (class "bathy") with preloaded bathymetry for the Mediterranean and Black Sea (0 to -1000 m). Online data retrieval using marmap::getNOAA.bathy() is still available by specifying a resolution value (e.g., res = 1). This dual approach ensures reproducibility and fast plotting in both offline and online environments, reducing the computational times accessing to the embedded dataset.bubble_plot_by_haul_indexes() to allow offline plotting: if res = NA, the function now uses an internal dataset med_bathy (class "bathy") with preloaded bathymetry for the Mediterranean and Black Sea (0 to -1000 m). Online data retrieval using marmap::getNOAA.bathy() is still available by specifying a resolution value (e.g., res = 1). This dual approach ensures reproducibility and fast plotting in both offline and online environments, reducing the computational times accessing to the embedded dataset.hauls_position() to allow offline plotting: if res = NA, the function now uses an internal dataset med_bathy (class "bathy") with preloaded bathymetry for the Mediterranean and Black Sea (0 to -1000 m). Online data retrieval using marmap::getNOAA.bathy() is still available by specifying a resolution value (e.g., res = 1). This dual approach ensures reproducibility and fast plotting in both offline and online environments, reducing the computational times accessing to the embedded dataset.bubbleplot_RS_by_hauls() corrected the functioning of verbose and save parameters.bubble_plot_by_haul_indexes() corrected the functioning of verbose and save parameters.hauls_position() corrected the functioning of verbose and save parameters.LFD() added verbose messages to enhance traceability and user feedback. Ensured consistent and explicit handling of missing data scenarios via informative verbose messages instead of cat() statements.index_on_grid() added verbose messages to enhance traceability and user feedback. Ensured consistent and explicit handling of missing data scenarios via informative verbose messages instead of cat() statements.sex_ratio_on_grid() added verbose messages to enhance traceability and user feedback. Ensured consistent and explicit handling of missing data scenarios via informative verbose messages instead of cat() statements.overlayGrid() added verbose messages to enhance traceability and user feedback. Ensured consistent and explicit handling of missing data scenarios via informative verbose messages instead of cat() statements.merge_TATB() to merge TA and TB tables only,merge_TATC() to merge TA and TC tables only,merge_TATBTC() vectorising for loops to reduce run-time while keeping identical
numerical results.BioIndex() function modified to create a report filename that now includes the MEDITS code of the analyzed species, the refernece GSA and the lower and upper depth values (e.g., BioIndex_results_ARISFOL_GSA18_Depth200-800m_2025-08-08_h09m15s24.zip). This makes it easier to organize and identify files, especially when running analyses for multiple species or depths (according to outcomes of RDBFIS II second training).BioIndex() documentation modified to specify the mm units required for both recruits and spawners cutoff thresholds (according to outcomes of RDBFIS II second training).bubbleplot_RS_by_hauls() documentation modified to specify the mm units required for both recruits and spawners cutoff thresholds (according to outcomes of RDBFIS II second training).index_recr() documentation modified to specify the mm units required for recruits cutoff threshold (according to outcomes of RDBFIS II second training).index_spawn() documentation modified to specify the mm units required for spawners cutoff threshold (according to outcomes of RDBFIS II second training).