Skip to contents

Looks up a one-paragraph + short-table explanation by filename (any leading directory components are stripped). Falls back to matching on the filename stem if the extension differs.

Usage

explain_file(filename)

Arguments

filename

The CSV filename, with or without a path.

Value

A character scalar containing the explanation. If no registered entry matches, returns a fallback listing the known files.

Examples

cat(explain_file("power_summary.csv"))
#> Question this file answers: "What sample did the power analysis run on,
#> and what anchors did it use?"
#> 
#> It's a long-format table with two columns — `metric` and `value` — one
#> row per quantity.  Rows include:
#>   - analysis_n                            Records in the analysis sample
#>   - heavy_drinking_prevalence_weighted    Weighted outcome prevalence
#>   - gender_levels_used                    Gender strata in the design
#>   - (plus eBAC endpoint anchor rows when those measures are present)
#> 
#> The actual power/sample-size grids live in the companion files:
#> `power_two_proportion_gender.csv` (two-proportion grid) and
#> `power_one_proportion_grid.csv` (one-proportion grid).