% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read-pedon-csv.R
\name{read_pedon_csv}
\alias{read_pedon_csv}
\title{Read a horizon spreadsheet (CSV/TSV) into a PedonRecord}
\usage{
read_pedon_csv(file, site = NULL, sep = "auto")
}
\arguments{
\item{file}{Path to a \code{.csv} (comma) or \code{.tsv} (tab) file, one row
per horizon.}

\item{site}{Optional named list of site metadata (see \code{\link{PedonRecord}}).
Defaults to \code{list(id = <file base name>)}.}

\item{sep}{Field separator. \code{"auto"} (default) uses a tab for
\code{.tsv} files and a comma otherwise.}
}
\value{
A \code{\link{PedonRecord}}.
}
\description{
The everyday entry point for anyone who has a soil profile in a spreadsheet:
one row per horizon, one column per attribute, using soilKey's canonical
column names (\code{top_cm}, \code{bottom_cm}, \code{designation},
\code{clay_pct}, \code{ph_h2o}, \code{munsell_hue_moist}, ...). The full list
is \code{names(horizon_column_spec())}; the quickest start is the bundled
template
\code{system.file("extdata", "perfil_exemplo.csv", package = "soilKey")}.
}
\details{
Only recognised columns are used (any extras are carried through untouched),
so a messy export still works - soilKey simply uses the columns it
understands. Site metadata (id, lat/lon, soil moisture / temperature regime)
is optional and passed via \code{site}; without it the profile still
classifies, just with less specificity where site data would have refined the
name.
}
\examples{
f <- system.file("extdata", "perfil_exemplo.csv", package = "soilKey")
pedon <- read_pedon_csv(f)
classify_all(pedon)$summary
}
\seealso{
\code{\link{classify_csv}} to go straight from a file to the three
  classifications; \code{\link{classify_all}}; \code{\link{PedonRecord}}.
}
