Package: framrsquared 0.5.0

Ty Garber

framrsquared: FRAM Database Interface

A convenient tool for interfacing with FRAM access databases in R environments.

Authors:Ty Garber [cre, aut], Collin Edwards [aut]

framrsquared_0.5.0.tar.gz
framrsquared_0.5.0.zip(r-4.5)framrsquared_0.5.0.zip(r-4.4)framrsquared_0.5.0.zip(r-4.3)
framrsquared_0.5.0.tgz(r-4.4-any)framrsquared_0.5.0.tgz(r-4.3-any)
framrsquared_0.5.0.tar.gz(r-4.5-noble)framrsquared_0.5.0.tar.gz(r-4.4-noble)
framrsquared_0.5.0.tgz(r-4.4-emscripten)framrsquared_0.5.0.tgz(r-4.3-emscripten)
framrsquared.pdf |framrsquared.html
framrsquared/json (API)

# Install 'framrsquared' in R:
install.packages('framrsquared', repos = c('https://framverse.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/framverse/framrsquared/issues

Pkgdown site:https://framverse.github.io

On CRAN:

5.10 score 6 stars 9 scripts 68 exports 63 dependencies

Last updated 10 days agofrom:42a490eb18. Checks:7 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKJan 02 2025
R-4.5-winOKJan 02 2025
R-4.5-linuxOKJan 02 2025
R-4.4-winOKJan 02 2025
R-4.4-macOKJan 02 2025
R-4.3-winOKJan 02 2025
R-4.3-macOKJan 02 2025

Exports:add_flag_textaddstock_checkaeq_mortalitybkfram_checks_cohochange_run_idcoho_mark_ratescompare_databasescompare_fishery_input_flagscompare_fishery_inputscompare_inputscompare_inputs_chartcompare_non_retention_input_flagscompare_non_retention_inputscompare_recruitscompare_runscompare_stock_fishery_rate_scalersconnect_fram_dbcopy_fishery_scalersdisconnect_fram_dberror_check_codefetch_quarto_templatesfetch_tablefetch_table_bkchinfilter_akfilter_bcfilter_cafilter_coastfilter_flagfilter_marinefilter_netfilter_orfilter_puget_soundfilter_sportfilter_wafishery_mortalityfram_clean_tablesfram_database_speciesfram_database_typefrs_stylecheck_assignmentfrs_stylecheck_snakecaseget_run_idsinitialize_projectmake_impacts_per_catch_heatmapmanagement_weekmortality_scalersmsf_encountersmsf_encounters_chinook_msf_encounters_coho_msf_landed_catchmsf_landed_catch_chinook_msf_landed_catch_coho_msf_mortalitiesmsf_mortalities_chinook_msf_mortalities_coho_msp_mortalityNR_flag_translateplot_stock_mortalityplot_stock_mortality_time_steppopulation_statisticspost_season_abundanceprovide_table_namesremove_runrun_infoscalers_flag_translatestatistical_weekstock_mortalitytruns_fisheriestruns_stocks

Dependencies:bitbit64blobcachemclicliprcolorspacecpp11crayonDBIdplyrfansifarverfastmapframrosettagenericsggplot2gluegtableherehmsisobandjanitorlabelinglatticelifecyclelubridatemagrittrMASSMatrixmemoisemgcvmunsellnlmeodbcpillarpkgconfigplogrprettyunitsprogresspurrrR6RColorBrewerRcppreadrrenvrlangrprojrootRSQLitescalessnakecasestringistringrtibbletidyrtidyselecttimechangetzdbutf8vctrsviridisLitevroomwithr

auditing_tools

Rendered fromauditing_tools.Rmdusingknitr::rmarkdownon Jan 02 2025.

Last update: 2025-01-02
Started: 2025-01-02

framrsquared

Rendered fromframrsquared.Rmdusingknitr::rmarkdownon Jan 02 2025.

Last update: 2025-01-02
Started: 2025-01-02

Readme and manuals

Help Manual

Help pageTopics
Adds a column with a text version of flags for either non-retention or fishery scalersadd_flag_text
Check FRAM database after adding new stockaddstock_check
Extract AEQ mortality from Chinook FRAM database. Refactored and stripped down from the framr package written by Dan Auerbach. https://github.com/FRAMverse/framr/aeq_mortality
Performs error checks of a backwards FRAM run Returns nested tibble with diagnosticsbkfram_checks_coho
Changes a run's ID number in a FRAM databasechange_run_id
*[Experimental]* Returns a tibble displaying predicted FRAMencounter mark rates by fishery, fishery type, and time-step.coho_mark_rates
Compare tables in two equivalent FRAM databasescompare_databases
Compares the fishery flags of two runscompare_fishery_input_flags
Compares the fishery inputs of two runscompare_fishery_inputs
Generates a dataframe that compares fishery scalers table for two runs identified by run_id'scompare_inputs
Generates a heat map of changed between two run inputs. Can be a very busy chart if not filtered down. Consider using a filter.compare_inputs_chart
Compares the non retention flags of two runscompare_non_retention_input_flags
Compares the non retention inputs of two runscompare_non_retention_inputs
Compares the recruit scalers of two runscompare_recruits
Generates a report to the console of changes to inputs between two runscompare_runs
Compares the stock fishery rate scalers of two runscompare_stock_fishery_rate_scalers
This is a connection object to a FRAM database. Returns a list used throughout the rest of this package which carries meta data.connect_fram_db
Experimental copying scaler inputs from one run to another DANGEROUScopy_fishery_scalers
Safely disconnect from FRAM databasedisconnect_fram_db
Check code for common errorserror_check_code
Creates quarto template filesfetch_quarto_templates
Fetches a complete table from a FRAM database. Returns a cleaned tibble.fetch_table
Safely fetch Chinook BackwardsFRAM tablefetch_table_bkchin
Filters a dataframe to Alaska fisheries. Will automatically detect whether it's working with a Chinook or Coho dataset if the tables were generated within this package. Requires a 'fishery_id' column name.filter_ak
Filters a dataframe to Canadian (BC) fisheries. Will automatically detect whether it's working with a Chinook or Coho dataset if the tables were generated within this package. Requires a 'fishery_id' column name.filter_bc
Filters a dataframe to California fisheries. Will automatically detect whether it's working with a Chinook or Coho dataset if the tables were generated within this package. Requires a 'fishery_id' column name.filter_ca
Filters a dataframe to Coastal fisheries. Will automatically detect whether it's working with a Chinook or Coho dataset if the tables were generated within this package. Requires a 'fishery_id' column name.filter_coast
NA's all the information in the FisheryScalers that's not being used e.g Flag 1 only NS Scalers will be returnedfilter_flag
Filters a dataframe to marine fisheries. Will automatically detect whether it's working with a Chinook or Coho dataset if the tables were generated within this package. Requires a 'fishery_id' column name.filter_marine
Filters a dataframe to net fisheries. Will automatically detect whether it's working with a Chinook or Coho dataset if the tables were generated within this package. Requires a 'fishery_id' column name.filter_net
Filters a dataframe to Oregon fisheries. Will automatically detect whether it's working with a Chinook or Coho dataset if the tables were generated within this package. Requires a 'fishery_id' column name.filter_or
Filters a dataframe to Puget Sound fisheries. Will automatically detect whether it's working with a Chinook or Coho dataset if the tables were generated within this package. Requires a 'fishery_id' column name.filter_puget_sound
Filters a dataframe to sport fisheries. Will automatically detect whether it's working with a Chinook or Coho dataset if the tables were generated within this package. Requires a 'fishery_id' column name.filter_sport
Filters a dataframe to Washington State fisheries. Will automatically detect whether it's working with a Chinook or Coho dataset if the tables were generated within this package. Requires a 'fishery_id' column name.filter_wa
Finds tables that contain a specific column namefind_tables_by_column_
Returns a tibble matching the Fishery Mortality screen.fishery_mortality
Cleans the names of FRAM tables and coverts to a tibblefram_clean_tables
Identifies the FRAM database species focus - Chinook or Cohofram_database_species
Identifies the FRAM database type - Full or Transferfram_database_type
Gets all run_ids of FRAM databaseget_run_ids
*[Experimental]* Initializes a FRAM projectinitialize_project
Generates an input summary based on a FisheryScalers dataframe. Probably end up streamlining / revising this.input_summary_
Make plots to show the amount of landed catch_per_impactmake_impacts_per_catch_heatmap
Vectorized approach to calculating the management week, returns an integermanagement_week
Guestimate the impact on a particular stock by multiplying its mortalities by the 'stock_mortality_ratio' produced by these functions.mortality_scalers
Produces the MSF screen report numbers for encounters. Returns different format depending database.msf_encounters
Returns a tibble matching the MSF screen report encounters for Chinook. This is specific for Chinook and in most cases msf_encounters() is preferable.msf_encounters_chinook_
Returns a tibble matching the MSF screen report encounters for Coho This is specific for Coho and in most cases msf_encounters() is preferable.msf_encounters_coho_
Produces the MSF screen report numbers for landed catch. Returns different format depending database.msf_landed_catch
Returns a tibble matching the MSF screen report landed catch for Chinook. This is specific for Chinook and in most cases msf_landed_catch() is preferable.msf_landed_catch_chinook_
Returns a tibble matching the MSF screen report landed catch for Coho This is specific for Coho and in most cases msf_landed_catch() is preferable.msf_landed_catch_coho_
Produces the MSF screen report numbers for mortalities. Returns different format depending database.msf_mortalities
Returns a tibble matching the MSF screen report mortalities for Chinook. This is specific for Chinook and in most cases msf_mortalities() is preferable.msf_mortalities_chinook_
Returns a tibble matching the MSF screen report mortalities for Coho This is specific for Coho and in most cases msf_mortalities() is preferable.msf_mortalities_coho_
Expand Chinook mortality table using Model-Stock Proportionmsp_mortality
Provides English translation of numeric non-retention flagsNR_flag_translate
Creates an ordered bar chart with the top number of mortalities per fishery.plot_stock_mortality
Creates an ordered bar chart with the top number of mortalities per fishery and time step.plot_stock_mortality_time_step
Returns a tibble matching the Population Statistics screen.population_statistics
Generates post-season January age 3 abundances by stock from post-season databases. Used for forecasting.post_season_abundance
List names of FRAM tableprovide_table_names
Removes a run in a FRAM databaseremove_run
Provides a print out of Run ID informationrun_info
Provides English translation of numeric scalers flagsscalers_flag_translate
Vectorized approach to calculating the statistical week, returns an integerstatistical_week
Helper function to check that all stock x age combinations are presentstock_age_checker
Helper function to check that stock id make sensestock_check_helper
Helper function to check that stock id exist in the Stock databasestock_id_comp
Returns a tibble matching the Fishery Mortality screen.stock_mortality
Framrsquared style guidefrs_stylecheck_assignment frs_stylecheck_snakecase styleguide
Returns a dataframe with fisheries defined by the TRuns report drivertruns_fisheries
Returns a dataframe with stocks defined by the TRuns report drivertruns_stocks
Convenience function to check fram_db inputvalidate_fram_db
Convenience function to check run_id inputvalidate_run_id
Welcome message, summarizing database informationwelcome