Searches for BMA weight CSV files produced by the Hurdle-NB model, reads them using automatic delimiter detection, and returns a single stacked data frame with normalized column names and a combo identifier.
read_bma_all(dir_csv, dir_out, stop_if_empty = TRUE, verbose = TRUE)A data frame with all BMA tables stacked and an added
combo_id column (source identifier) and a combo
column (control combo). If nothing is found and
stop_if_empty = FALSE, an empty tibble is returned.
Character scalar; directory where BMA CSV files are
expected (for example "bma_weights_specC_ctrl*.csv").
Character scalar; output directory used during the experiment, which may contain BMA files or a fallback RDS object.
Logical; if TRUE, an informative error
is thrown when no valid BMA tables are found. If FALSE, a
warning is issued and an empty tibble is returned.
Logical; if TRUE, prints diagnostic messages
about the search paths, files found, and detected ELPD column.
The function:
Looks for CSV files matching the pattern
"bma_weights_specC_ctrl*.csv" in dir_csv, and if
none are found, searches recursively in dir_out.
Reads each candidate file via rc_auto() and keeps only
non-empty data frames.
If no CSV files are usable, optionally falls back to an RDS
file "experimento_mejorado_all.rds" under dir_out
and tries to extract BMA tables from allobj$bma.
Normalizes column names with normalize_names(), ensures
a combo column exists, detects the ELPD column, and sorts
rows by decreasing ELPD.