% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gapfill.R
\name{gapfill_derive_horizon}
\alias{gapfill_derive_horizon}
\title{Fill horizon attributes derivable BY DEFINITION from the same horizon}
\usage{
gapfill_derive_horizon(pedon, overwrite = FALSE)
}
\arguments{
\item{pedon}{A \code{\link{PedonRecord}}.}

\item{overwrite}{If \code{FALSE} (default) only \code{NA} target cells are
filled.}
}
\value{
Invisibly, the mutated \code{pedon}; attribute
        \code{"gapfill_derive_horizon"} records the count filled.
}
\description{
Recovers cells that are exact closures of other measured columns in the same
horizon (not statistical estimates): the texture third (clay/silt/sand) when
the other two are present and sum to \\< 100; effective CEC as
\code{sum(bases) + al}; aluminium saturation as \code{100 * al / ecec}; and
base saturation as \code{100 * sum(bases) / cec}. Every fill is written with
\code{source = "inferred_prior"} so the \code{\link{PedonRecord}} authority
order keeps it from displacing a measured value and the evidence grade drops
to \code{"C"}. Companion to \code{\link{gapfill_within_pedon}} (depth
interpolation) and \code{\link{apply_soilgrids_depth_prior}} (external prior);
reachable via the \code{gapfill = list(method = "derive")} argument of the
classifiers.
}
\seealso{
\code{\link{gapfill_within_pedon}}, \code{\link{apply_soilgrids_depth_prior}}
}
