% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/reporting.R
\name{codebook_report}
\alias{codebook_report}
\title{Generate a survey codebook from an instrument object}
\usage{
codebook_report(instrument, format = c("html", "md"))
}
\arguments{
\item{instrument}{An \code{sframe} object.}

\item{format}{Character. Output format. Either \code{"html"} or \code{"md"}.}
}
\value{
An object of class \code{sframe_codebook}, a list with elements
\code{instrument_meta}, \code{items_table}, \code{choices_table}, and \code{scales_table}.
Call \code{print()} to display a compact summary or use \code{render_report()} to
include the codebook in a full report.
}
\description{
Produces a structured codebook listing all items, their types, choice sets,
scale membership, and reverse-coding status. The codebook can be rendered
as HTML or Markdown.
}
\examples{
cs    <- sf_choices("ag5", 1:5,
           c("Strongly disagree", "Disagree", "Neutral",
             "Agree", "Strongly agree"))
i1    <- sf_item("sat_1", "Item 1", type = "likert",
                 choice_set = "ag5", scale_id = "sat")
i2    <- sf_item("sat_2", "Item 2", type = "likert",
                 choice_set = "ag5", scale_id = "sat")
scale <- sf_scale("sat", "Satisfaction", items = c("sat_1", "sat_2"))
instr <- sf_instrument("Demo Survey", components = list(cs, i1, i2, scale))

cb <- codebook_report(instr)
print(cb)
nrow(cb$items_table)
nrow(cb$scales_table)
}
\seealso{
\code{\link[=render_report]{render_report()}}
}
