% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gho.R
\name{gho_coverage}
\alias{gho_coverage}
\title{Summarise Per-Location Data Coverage of a GHO Indicator}
\usage{
gho_coverage(
  indicator,
  spatial_type = "country",
  area = NULL,
  year_from = NULL,
  year_to = NULL
)
}
\arguments{
\item{indicator}{Character scalar. The indicator code
(e.g. \code{"WHOSIS_000001"}).}

\item{spatial_type}{Character. Spatial dimension to filter on:
one of \code{"country"}, \code{"region"}, \code{"global"}. Defaults to
\code{"country"} since per-country coverage is the typical use
case. Pass \code{NULL} for all spatial levels.}

\item{area}{Character vector of country or region codes
(e.g. \code{c("FRA", "DEU")}). Default \code{NULL} returns all areas
for the chosen \code{spatial_type}.}

\item{year_from}{Numeric. Start year filter (inclusive).
Default \code{NULL}.}

\item{year_to}{Numeric. End year filter (inclusive).
Default \code{NULL}.}
}
\value{
A \link[tibble:tibble]{tibble} with one row per location and
columns:
\itemize{
\item \code{location} (chr) — the \code{SpatialDim} value (typically ISO3).
\item \code{year_min} (int) — earliest year with data.
\item \code{year_max} (int) — latest year with data.
\item \code{n_obs} (int) — number of observations.

Sorted by \code{location}. Empty input or service failure returns
an empty tibble with the same four columns.
}
}
\description{
Fetches only the \code{SpatialDim} and \code{TimeDim} columns for a GHO
indicator (much lighter than \code{\link[=gho_data]{gho_data()}}) and summarises the
year range and observation count per location. Useful for
answering "which countries have data, and for what years?"
before committing to a full download.
}
\examples{
\donttest{
# Year coverage of life expectancy for three countries
gho_coverage("WHOSIS_000001", area = c("FRA", "DEU", "JPN"))

# All countries with any life-expectancy data, since 2010
gho_coverage("WHOSIS_000001", year_from = 2010)
}
}
\seealso{
\code{\link[=gho_data]{gho_data()}}, \code{\link[=gho_has_data]{gho_has_data()}}, \code{\link[=gho_count]{gho_count()}}.
}
