% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/uniformTaxonomy.R
\name{uniformTaxonomy}
\alias{uniformTaxonomy}
\title{Create a complete and uniform taxonomy dataframe.}
\usage{
uniformTaxonomy(taxonomyData)
}
\arguments{
\item{taxonomyData}{\code{tibble}. A dataframe containing taxonomy data provided
by the EPPO service for a given EPPO code.}
}
\value{
A dataframe where each row represents one of the expected taxonomic
ranks. Fields corresponding to ranks not present in the original taxonomy
are filled with \code{NA}. The \code{level} column is excluded from the output. The
column \code{queried_eppo_code} NA values are filled with the right code.
}
\description{
This function normalizes the taxonomy returned by the EPPO service,
producing a uniform structure that includes all possible taxonomic
categories, even when some of them are not present in the original result.
}
\details{
The function uses an internal set of known taxonomic ranks and performs
a left join with the \code{taxonomy} dataframe, filling missing ranks with \code{NA}.
After the join, the column \code{level} from the original taxonomy is removed,
since the rank order is fully defined by the internal reference list. The
column \code{queried_eppo_code} NA values are filled with the right code.
}
\examples{
\dontrun{
# Retrieve taxonomy data from the EPPO service.
taxonData_ <- taxon(eppoCodes = c("BEMITA"), services = c("taxonomy"))

# Create a uniform taxonomy with all ranks.
taxonomyData_ <- uniformTaxonomy(taxonomyData = taxonData_$taxonomy)
}

}
