% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_data.R
\name{calculate_market_metrics}
\alias{calculate_market_metrics}
\title{Calculate Market Metrics for Seed and Plant Prices}
\usage{
calculate_market_metrics()
}
\value{
A named list containing:
\describe{
\item{averages}{A data frame with average seed, NL plant, and PL plant prices.}
\item{highest_seed}{Data frame with species having the highest seed price.}
\item{lowest_seed}{Data frame with species having the lowest seed price.}
\item{highest_nl_plant}{Data frame with species having the highest NL plant price.}
\item{lowest_nl_plant}{Data frame with species having the lowest NL plant price.}
\item{highest_pl_plant}{Data frame with species having the highest PL plant price.}
\item{lowest_pl_plant}{Data frame with species having the lowest PL plant price.}
}
}
\description{
Retrieves market data from the \code{market_dynamics} table in the ILORA database
and computes key metrics for seed and plant prices. Metrics include average prices,
and identification of species with the highest and lowest prices for seeds,
nursery-live plants (NL), and plant-live plants (PL).
}
\details{
NL refers to Nursery-Live plants and PL refers to Plant-Live plants.
The function calculates averages across all species recorded in the database and identifies
extremes for each price category.
}
\examples{
\donttest{
# Compute market metrics
market_metrics <- calculate_market_metrics()

# View average prices
market_metrics$averages

# View species with highest seed price
market_metrics$highest_seed
}

}
