% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/write_readme.R
\name{dfdr_write_readme}
\alias{dfdr_write_readme}
\title{Write a human-readable \code{README.md} report}
\usage{
dfdr_write_readme(diag, out_dir, filename = "README.md")
}
\arguments{
\item{diag}{A list as returned by \code{\link{dfdr_run_all}}.}

\item{out_dir}{Character scalar. Output directory (created if it does not exist).}

\item{filename}{Character scalar. Markdown filename (default \code{"README.md"}).}
}
\value{
The path to the written README file, returned invisibly. The function is called
for its side effect of writing a file to disk.
}
\description{
Produces a lightweight narrative report in Markdown that summarises the most
important diagnostics (headline summary, key plots, exported tables) and records
per-list metadata (unit, scope, q-source, etc.) from a \code{\link{dfdr_run_all}}
result. This is intended to accompany an export folder for auditing and sharing.
}
\examples{
library(tibble)

# Minimal dfdr_run_all-like object for demonstrating README writing
df <- tibble(
  id = c("1","2","3"),
  run = "run1",
  is_decoy = c(FALSE, TRUE, FALSE),
  score = c(10, 9, 8),
  q = c(0.01, 0.02, 0.03),
  pep = NA_real_
)
x <- as_dfdr_tbl(df, unit = "psm", scope = "global", q_source = "toy")

diag <- list(
  objects = list(toy = x),
  params = list(alpha_main = 0.01),
  tables = list(headline = tibble(list = "toy", alpha = 0.01)),
  warnings = character()
)

out_dir <- tempdir()
dfdr_write_readme(diag, out_dir = out_dir, filename = "README_example.md")

}
