% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils_provenance.R
\name{get_provenance}
\alias{get_provenance}
\title{Retrieve metabom8 provenance metadata}
\usage{
get_provenance(x, step = NULL, param = NULL)
}
\arguments{
\item{x}{A metabom8 object (named list with element \code{X}) or a numeric
matrix containing metabom8 provenance metadata.}

\item{step}{Optional. Either:
\itemize{
\item Numeric index of the preprocessing step
\item Character string matching the recorded step name
}
If \code{NULL}, the full provenance log is returned.}

\item{param}{Optional character string specifying a parameter name within
the selected step. If provided, only this parameter value is returned.}
}
\value{
Depending on the arguments:
\itemize{
\item Full provenance list (if \code{step = NULL})
\item A single preprocessing step (if \code{step} specified)
\item A single parameter value (if \code{param} specified)
}
}
\description{
Extracts preprocessing provenance stored in the \code{"m8_prep"} attribute.
Allows access to the full processing log, a specific step, or a specific
parameter within a step.
}
\details{
Provenance metadata are recorded automatically by metabom8 preprocessing
functions and stored as structured attributes on the spectral matrix.
This function provides programmatic access to these records.
}
\examples{
data(hiit_raw)

hiit_proc <- hiit_raw |>
  calibrate(type = "tsp") |>
  excise()

# Retrieve full log
log <- get_provenance(hiit_proc)

# Retrieve specific step
get_provenance(hiit_proc, step = 2)

# Retrieve parameter from a named step
get_provenance(hiit_proc, step = "calibrate", param = "target")

}
\seealso{
Other provenance: 
\code{\link{add_note}()},
\code{\link{print_provenance}()}
}
\concept{provenance}
