% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/aqp-interop.R
\name{from_aqp}
\alias{from_aqp}
\title{Convert an aqp SoilProfileCollection back to a list of PedonRecord}
\usage{
from_aqp(spc)
}
\arguments{
\item{spc}{A \code{aqp::SoilProfileCollection}.}
}
\value{
A list of \code{\link{PedonRecord}} objects (length =
        \code{length(spc)}).
}
\description{
Inverse of \code{\link{as_aqp}}. Walks each profile in the SPC,
renames aqp's canonical horizon column names back to soilKey's
(\code{top} -> \code{top_cm}, \code{name} -> \code{designation},
\code{clay} -> \code{clay_pct}, ...), assembles a
\code{\link{PedonRecord}} per profile, and returns the list.
}
\details{
Round-trip property: \code{from_aqp(as_aqp(pedon))} reproduces
\code{pedon} modulo column ordering.
}
\examples{
\donttest{
if (requireNamespace("aqp", quietly = TRUE)) {
  pedons <- list(make_ferralsol_canonical(), make_luvisol_canonical())
  spc <- as_aqp(pedons)
  pedons2 <- from_aqp(spc)
  identical(pedons[[1]]$horizons$clay_pct, pedons2[[1]]$horizons$clay_pct)
  #> [1] TRUE
}
}
}
\seealso{
\code{\link{as_aqp}}, the forward conversion.
}
