% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api-viewer.R
\name{launch_mfrmr_viewer}
\alias{launch_mfrmr_viewer}
\title{Launch a local Shiny viewer for an mfrm_results object}
\usage{
launch_mfrmr_viewer(
  x,
  top_n = 100L,
  launch.browser = TRUE,
  port = NULL,
  host = getOption("shiny.host", "127.0.0.1"),
  display.mode = c("auto", "normal", "showcase"),
  return_app = FALSE,
  ...
)
}
\arguments{
\item{x}{An \code{\link[=mfrm_results]{mfrm_results()}} object.}

\item{top_n}{Maximum number of table-index rows shown in the summary payload.}

\item{launch.browser}{Passed to \code{shiny::runApp()}.}

\item{port}{Optional port passed to \code{shiny::runApp()}. \code{NULL} lets Shiny
choose its default.}

\item{host}{Host passed to \code{shiny::runApp()}. Defaults to the local host.}

\item{display.mode}{Passed to \code{shiny::runApp()}.}

\item{return_app}{Logical; if \code{TRUE}, return the Shiny app object without
running it. This is useful for embedding or testing.}

\item{...}{Additional arguments passed to \code{shiny::runApp()} when
\code{return_app = FALSE}.}
}
\value{
Invisibly returns the value from \code{shiny::runApp()}, or the Shiny app
object when \code{return_app = TRUE}.
}
\description{
\code{launch_mfrmr_viewer()} opens a local Shiny app for reading the object
returned by \code{\link[=mfrm_results]{mfrm_results()}}. It is intentionally a viewer over an existing
comprehensive results object, not a new estimation interface.
}
\details{
The viewer assumes that fitting, diagnostics, and section selection have
already happened through \code{\link[=mfrm_results]{mfrm_results()}}. This keeps GUI exploration
separate from reproducible analysis setup: the Replay tab displays the
\code{mfrm_results()} scaffold stored in the result object.

The app includes tabs for overview/triage, QC evidence, APA-style report
text when \code{include = "publication"} or \code{"apa"} was used, available bias
screens, pathway plotting, unexpected-response inspection, generic tables,
generic plot routes, and replay code. QC, Report, Bias, and Pathway/Misfit
tabs show local section-status tables so unavailable or not-requested
sections are visible where users look for them. Bias-interaction follow-up
still requires an explicit facet-pair decision outside the viewer.

\code{shiny} is an optional dependency. Install it before using this viewer:
\code{install.packages("shiny")}.
}
\examples{
toy <- load_mfrmr_data("example_core")
fit <- fit_mfrm(
  toy,
  person = "Person",
  facets = c("Rater", "Criterion"),
  score = "Score",
  method = "JML",
  maxit = 30
)
res <- mfrm_results(fit, include = c("fit", "diagnostics", "tables"))

if (interactive() && requireNamespace("shiny", quietly = TRUE)) {
  launch_mfrmr_viewer(res)
}
}
\seealso{
\code{\link[=mfrm_results]{mfrm_results()}}, \code{\link[=mfrm_results_interactive]{mfrm_results_interactive()}}
}
