% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CharAnalysis.R
\name{CharAnalysis}
\alias{CharAnalysis}
\title{Run the full CharAnalysis pipeline}
\usage{
CharAnalysis(file_name = NULL)
}
\arguments{
\item{file_name}{Path to the \code{*_charParams.csv} (or \code{.xlsx})
parameter file.  If omitted (or \code{NULL}), a system file-picker dialog
is opened so you can navigate to the file interactively -- matching the
MATLAB behaviour of typing \code{CharAnalysis} with no argument.  In
non-interactive sessions (e.g. scripts, batch jobs) the argument is
required and an error is thrown if it is missing.}
}
\value{
Named list with the following elements:
  \describe{
    \item{charcoal}{List of raw and resampled series.  After Phase 2:
      includes \code{accIS} (smoothed background) and \code{peak}
      (C_peak, either residuals or ratios).  After Phase 3: also includes
      \code{charPeaks} (\eqn{[N \times T]} binary peak matrix),
      \code{charPeaksThresh}, \code{peaksTotal}, and \code{threshFRI}.
      After Phase 4: also includes \code{peakInsig},
      \code{peakMagnitude}, \code{smoothedFireFrequ}, \code{peaksFrequ}.}
    \item{pretreatment}{Pretreatment parameter list (possibly updated by
      [char_pretreatment()] -- e.g. \code{yrInterp} auto-set,
      \code{zoneDiv} end-value corrected).}
    \item{smoothing}{Smoothing parameter list.}
    \item{peak_analysis}{Peak-analysis parameter list.}
    \item{results}{Results / output parameter list.}
    \item{site}{Character string: site name.}
    \item{gap_in}{Integer matrix (nGaps x 2) of missing-value gap indices.}
    \item{char_thresh}{Threshold list returned by [char_thresh_global()] or
      [char_thresh_local()].  Contains \code{pos}, \code{neg}, \code{SNI},
      \code{GOF}, and (after Phase 3) \code{minCountP} -- the
      \eqn{[N \times T]} matrix of Shuie-Bain p-values.}
    \item{post}{Post-processing list from [char_post_process()]: FRI
      series, smoothed FRI curve, per-zone Weibull statistics, and the
      assembled \code{char_results} output matrix (\eqn{N \times 33}).}
    \item{char_results}{Numeric matrix (\eqn{N \times 33}) matching the
      MATLAB \code{charResults} output exactly (alias of
      \code{post$char_results}).}
  }
}
\description{
Top-level wrapper that calls each analytical stage in sequence and returns
all intermediate and final results as a single named list.
}
\examples{
\donttest{
  # Run the full pipeline on the bundled example dataset:
  params_file <- system.file("validation", "CO_charParams.csv",
                             package = "CharAnalysis")
  out <- CharAnalysis(params_file)
  # Phase 2 outputs
  head(data.frame(ageTop_i   = out$charcoal$ybpI,
                  charAcc_i  = out$charcoal$accI,
                  charBkg_i  = out$charcoal$accIS,
                  charPeak_i = out$charcoal$peak))
  # Phase 3 outputs
  sum(out$charcoal$charPeaks[, ncol(out$charcoal$charPeaks)])
}
}
\seealso{
[char_parameters()], [char_validate_params()],
  [char_pretreatment()], [char_smooth()], [char_thresh_global()],
  [char_thresh_local()], [char_peak_id()], [char_post_process()]
}
