% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tsqca_fiss_core.R
\name{compute_fiss_core}
\alias{compute_fiss_core}
\title{Compute Fiss Core/Peripheral Classification for Sweep Results}
\usage{
compute_fiss_core(result, conditions = NULL)
}
\arguments{
\item{result}{A sweep result object with \code{$details} and
\code{$settings} slots (e.g., from \code{otSweep(..., return_details = TRUE)}).}

\item{conditions}{Character vector. Condition names (used for consistent
row ordering in charts). If \code{NULL}, extracted automatically.}
}
\value{
The original \code{result} object with an additional
  \code{$fiss_core} slot: a named list keyed by threshold (character),
  each entry containing:
  \itemize{
    \item \code{parsim_expression} — parsimonious solution expression
    \item \code{interm_expression} — intermediate solution expression
    \item \code{classification}    — data frame with columns
      \code{term_idx}, \code{term_expr}, \code{condition},
      \code{status}, \code{type}
  }
}
\description{
Takes an existing threshold-sweep result object (produced by
\code{\link{otSweep}}, \code{\link{ctSweepS}}, \code{\link{ctSweepM}},
or \code{\link{dtSweep}}) and augments it with Fiss (2011)
core/peripheral classification.
}
\details{
The classification requires that:
\itemize{
  \item The sweep was run with \code{include = "?"} (to allow parsimonious
        computation)
  \item \code{return_details = TRUE} was used (truth tables must be stored)
  \item \code{dir.exp} was specified (i.e., the sweep produced intermediate
        solutions — core/peripheral is only meaningful when comparing
        parsimonious vs intermediate)
}

For each threshold in the result, this function:
\enumerate{
  \item Retrieves the intermediate solution already stored in
        \code{result$details}.
  \item Re-runs \code{QCA::minimize()} on the same truth table with
        \code{dir.exp = NULL} to obtain the parsimonious solution.
  \item Compares the two solutions: conditions appearing in both are
        \strong{core}; conditions appearing only in the intermediate
        solution are \strong{peripheral}.
}
}
\examples{
\dontrun{
library(ThSQCA)
data(sample_data)

# Step 1: Run intermediate sweep (dir.exp required)
res <- otSweep(
  dat        = sample_data,
  outcome    = "Y",
  conditions = c("X1", "X2", "X3"),
  sweep_range = 6:8,
  thrX       = c(X1 = 7, X2 = 7, X3 = 7),
  include    = "?",
  dir.exp    = c(1, 1, 1),
  return_details = TRUE
)

# Step 2: Augment with Fiss core/peripheral classification
res_fiss <- compute_fiss_core(res, conditions = c("X1", "X2", "X3"))

# Step 3: Generate Fiss-style chart
cat(generate_fiss_chart(res_fiss, symbol_set = "unicode"))
}

}
\references{
Fiss, P. C. (2011). Building better causal theories: A fuzzy set approach
to typologies in organization research. \emph{Academy of Management Journal},
54(2), 393-420.
}
\seealso{
\code{\link{generate_fiss_chart}}
}
