| Title: | What the Package Does (One Line, Title Case) |
|---|---|
| Description: | QAQC tools for comparing FRAM databases. |
| Authors: | Collin Edwards [aut, cre] (ORCID: <https://orcid.org/0000-0002-4937-5159>) |
| Maintainer: | Collin Edwards <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-07-09 16:47:54 UTC |
| Source: | https://github.com/FRAMverse/framqaqc |
Compare tables between two databases
compare_table_across_dbs(fram_db_1, fram_db_2, table_name)compare_table_across_dbs(fram_db_1, fram_db_2, table_name)
fram_db_1 |
fram database connection to first database (used as reference for ratio calculations) |
fram_db_2 |
fram database connection to second database |
table_name |
Name of table to compare |
tibble of comparisons, including run_id, as appropriate stock_id, age, fishery_id, time_step. $db1 and $db2 give the values in the database for column $metric; $diff_exact has db1-db2, and $diff_ratio has db2/db1.
## Not run: library(framrsquared) fram_a = connect_fram_db( "C:/Repos/fram multirun testing/Formal testing/coho_preseason_notamm_a.mdb", read_only = TRUE, quiet = TRUE) fram_c = connect_fram_db( "C:/Repos/fram multirun testing/Formal testing/coho_preseason_notamm_c.mdb", read_only = TRUE, quiet = TRUE) compare_table_across_dbs(fram_a, fram_c, "Mortality") disconnect_fram_db(fram_a) disconnect_fram_db(fram_b) ## End(Not run)## Not run: library(framrsquared) fram_a = connect_fram_db( "C:/Repos/fram multirun testing/Formal testing/coho_preseason_notamm_a.mdb", read_only = TRUE, quiet = TRUE) fram_c = connect_fram_db( "C:/Repos/fram multirun testing/Formal testing/coho_preseason_notamm_c.mdb", read_only = TRUE, quiet = TRUE) compare_table_across_dbs(fram_a, fram_c, "Mortality") disconnect_fram_db(fram_a) disconnect_fram_db(fram_b) ## End(Not run)
Creates faceted plots based on the output of compare_table_across_dbs(), with the values from one database plotted against the corresponding values from the other. If two databases are exactly the same, all points should fall on the 1:1 line; dashed 1:1 line included as reference. To improve performance, avoids plotting duplicate and near-duplicate entries. "near-duplicate" is controlled by argument round_digits.
plot_comparisons_exact(tab, round_digits = 0)plot_comparisons_exact(tab, round_digits = 0)
tab |
tibble produced from |
round_digits |
Digits to round to before identifying entries as "near-duplicate" entries. Defaults to 0 (e.g., round to the nearest fish). Appropriate to reduce when comparing tables in which values are much smaller. |
ggplot object
Creates faceted plots based on the output of compare_table_across_dbs(), with the ratio of db2/db1 plotted against the values of db1. If two databases are exactly the same, all points should have a ratio of exactly 1; dashed horizontal line at 1 is included as reference. To improve performance, avoids plotting duplicate and near-duplicate entries. "near-duplicate" values of db1 is controlled by argument round_digits; ratio values within 0.001 are treated as near-duplicate.
plot_comparisons_ratio(tab, round_digits = 0)plot_comparisons_ratio(tab, round_digits = 0)
tab |
tibble produced from |
round_digits |
digits to round db1 to in order to avoid plotting near-duplicate points. |
ggplot object
compare_table_across_dbs()
Makes a quick summary of the outputs of compare_table_across_dbs(), giving min, max, 0.01 and 0.99 quantiles of the absolute differences of values by run id. A perfect match would have values that are all 0.
summarize_exact(tab)summarize_exact(tab)
tab |
tibble produced from |
gt with summary information.
compare_table_across_dbs()
Makes a quick summary of the outputs of compare_table_across_dbs(), giving min, max, 0.01 and 0.99 quantiles of the ratio of values from db2 / db1, by run id. Ignore entries with values <=1 to db1 to avoid divide-by-zero issues and inflation of small differences.
summarize_ratio(tab)summarize_ratio(tab)
tab |
tibble produced from |
gt with summary information.