% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/febr.R
\name{read_febr_pedons}
\alias{read_febr_pedons}
\title{Load FEBR datasets as a list of PedonRecord objects}
\usage{
read_febr_pedons(
  dataset_codes = c("ctb0039"),
  febr_repo = NULL,
  min_munsell_coverage = 0,
  verbose = TRUE
)
}
\arguments{
\item{dataset_codes}{Character vector of FEBR dataset IDs
(e.g. \code{c("ctb0032", "ctb0562")}). Pass \code{"all"}
to download every Munsell-bearing dataset; this is heavy
(network calls per dataset). Default: a small curated
sample for development.}

\item{febr_repo}{Optional override for the FEBR repository
location, forwarded to \code{febr::readFEBR}.}

\item{min_munsell_coverage}{Drop pedons whose horizons are
\emph{all} missing Munsell. Default 0 (keep all);
set to 0.5 to keep only pedons with at least 50% of
horizons having a Munsell hue.}

\item{verbose}{If \code{TRUE} (default), prints per-dataset
join statistics.}
}
\value{
A list of \code{\link{PedonRecord}} objects with
        \code{site$id} = FEBR \code{observacao_id},
        \code{site$reference_sibcs} = the surveyor's classification
        when available, and one horizon per FEBR \code{camada}
        row.
}
\description{
Wraps \code{febr::readFEBR()} (CRAN package, FEBR v1.9.9+ recommended)
and adapts the returned \code{camada} (layer) +
\code{observacao} tables to the soilKey schema. Auto-detects
Munsell columns across the ~6 distinct conventions found in the
200 FEBR datasets that carry color data, parses PT-BR Munsell
strings (\code{"2,5YR 3/6"}) and converts FEBR's standard units
to soilKey conventions.
}
\details{
Per the May 2026 scan, ~80% of FEBR datasets have Munsell. Use
\code{\link{febr_index_munsell}} to get the curated list of
Munsell-bearing dataset IDs.
}
\examples{
\donttest{
# 'febr' is not on CRAN; we resolve the name through a variable so
# R CMD check does not flag a missing Suggests entry. The example
# no-ops on CRAN's machines and runs locally once the user has
# installed it from GitHub (febr-team/febr-package).
febr_pkg <- "febr"
if (requireNamespace(febr_pkg, quietly = TRUE)) {
  # Single dataset (35 perfis, 100\% Munsell coverage)
  pedons <- try(read_febr_pedons("ctb0039"), silent = TRUE)

  # Multiple datasets
  # pedons <- read_febr_pedons(c("ctb0032", "ctb0562", "ctb0568"))

  # All Munsell-bearing datasets (slow; 200 datasets, ~36k horizons)
  # all_pedons <- read_febr_pedons("all")
}
}
}
\seealso{
\code{\link{febr_index_munsell}},
         \code{\link{load_bdsolos_csv}}.
}
