% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gapfill.R
\name{gapfill_by_predicted_taxon}
\alias{gapfill_by_predicted_taxon}
\title{Fill missing horizon attributes from the predicted taxon's mean profile}
\usage{
gapfill_by_predicted_taxon(
  pedon,
  taxon_profiles,
  system = c("sibcs", "wrb2022", "usda"),
  attrs = NULL,
  confidence = 0.55
)
}
\arguments{
\item{pedon}{A \code{\link{PedonRecord}}.}

\item{taxon_profiles}{Output of \code{\link{build_taxon_profiles}}.}

\item{system}{One of \code{"sibcs"} (default), \code{"wrb2022"}, \code{"usda"}.}

\item{attrs}{Attributes to fill (default: those present in the matched profile).}

\item{confidence}{Provenance confidence (default 0.55, below a coordinate prior).}
}
\value{
Invisibly, the mutated \code{pedon}; attribute
        \code{"gapfill_by_predicted_taxon"} records the taxon + cells filled.
}
\description{
Classifies \code{pedon} with NO fill to get a provisional taxon, then fills
its missing cells from \code{taxon_profiles[[<that taxon>]]} (built by
\code{\link{build_taxon_profiles}}). Non-circular: the fill is keyed on the
model's own prediction, not the reference. Each fill is written with
\code{source = "inferred_prior"} (grade C). Reachable via
\code{gapfill = list(method = "taxon", taxon_profiles = <...>)}.
}
\seealso{
\code{\link{build_taxon_profiles}}, \code{\link{apply_soilgrids_depth_prior}}
}
