% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/aqp-interop.R
\name{as_aqp}
\alias{as_aqp}
\title{Convert one or more PedonRecord objects to an aqp SoilProfileCollection}
\usage{
as_aqp(x)
}
\arguments{
\item{x}{A \code{\link{PedonRecord}} or a list of them.}
}
\value{
A \code{aqp::SoilProfileCollection}.
}
\description{
Builds a \code{aqp::SoilProfileCollection} from one \code{PedonRecord}
or a list of them. Standard soilKey columns (\code{top_cm},
\code{bottom_cm}, \code{designation}, \code{clay_pct}, \code{sand_pct},
\code{silt_pct}) are renamed to aqp's canonical convention (\code{top},
\code{bottom}, \code{name}, \code{clay}, \code{sand}, \code{silt}).
All other columns are passed through unchanged. Site-level slots
(\code{lat}, \code{lon}, \code{country}, \code{parent_material},
\code{reference_*}, \code{nasis_diagnostic_features}, etc.) are
attached to the SPC's site table.
}
\details{
Requires the \code{aqp} package, listed in Suggests; the function
raises a clear error if aqp is not installed.
}
\examples{
\dontrun{
library(soilKey)
library(aqp)

pedons <- list(make_ferralsol_canonical(), make_luvisol_canonical())
spc <- as_aqp(pedons)
length(spc)         # 2 profiles
aqp::horizons(spc)  # one row per horizon, aqp-named columns
}
}
\seealso{
\code{\link{from_aqp}}, the inverse conversion.
}
