% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/coverage.R
\name{coverage}
\alias{coverage}
\title{Summarize Trait Coverage}
\usage{
coverage(data)
}
\arguments{
\item{data}{A data frame or matrix with observations, typically species or
other taxa, in rows and traits in columns. All supplied columns are
treated as traits. Species or taxon identifiers should therefore be stored
as row names or removed before calling the function.}
}
\value{
A data frame with one row for each supplied trait and an additional
  `"All"` row. It contains the following columns:
  \describe{
    \item{Trait}{Trait name. The `"All"` row summarizes complete cases
      across all supplied traits.}
    \item{Available_count}{For an individual trait, the number of
      observations with a non-missing value. For the `"All"` row, the
      number of observations with complete data for all traits.}
    \item{Missing_count}{For an individual trait, the number of
      observations with a missing value. For the `"All"` row, the number
      of observations missing at least one trait.}
    \item{Trait_coverage_rate}{The percentage of available observations,
      returned as a character string containing a percent sign.}
  }

  Overall coverage across all cells is displayed as a message but is not
  included in the returned data frame.
}
\description{
`coverage()` summarizes missingness in a trait dataset for individual
traits, complete cases across all supplied traits, and all trait values
combined.
}
\details{
Coverage is summarized in three ways:
\itemize{
  \item Trait-specific coverage is the percentage of observations with a
    non-missing value for each trait.
  \item Coverage of complete cases is the percentage of observations with
    non-missing values for every supplied trait and is reported in the
    `"All"` row.
  \item Overall coverage is the percentage of all cells in the supplied
    dataset that contain non-missing values and is displayed when the
    function runs.
}

Missingness is defined using `is.na()`. The function summarizes data
availability but does not evaluate whether non-missing values are
biologically valid for a particular trait.
}
\examples{
trait_data <- data.frame(
  PlantHeight = c(1.2, 1.5, NA, 2.1, 1.8),
  LDMC = c(0.5, NA, 0.8, 1.2, 0.9),
  LA = c(15.2, 18.5, 12.3, NA, 16.7)
)

coverage(trait_data)

}
