% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fires.R
\name{get_fires_emissions}
\alias{get_fires_emissions}
\title{Download and plot essential climate data}
\usage{
get_fires_emissions(
  place = "WORLD",
  year = as.numeric(format(Sys.Date(), "\%Y")),
  use_cache = TRUE,
  write_cache = getOption("hs_write_cache")
)
}
\arguments{
\item{place}{(string) Region or country for which to retrieve data. May be one of the
following regional aggregates: \code{"WORLD"} (default), \code{"UN_EUR"} (Europe),
\code{"UN_AFR"} (Africa), \code{"UN_ASI"} (Asia), \code{"UN_AME"} (Americas),
or \code{"UN_OCE"} (Oceania). Alternatively, supply an ISO 3166-1 alpha-3 country
code such as \code{"USA"}, \code{"CAN"}, or \code{"BRA"}.}

\item{year}{(numeric) Four-digit year for which to retrieve data. Must be 2012 or later.
Defaults to the current year.}

\item{use_cache}{(boolean) Return cached data if available, defaults to TRUE. Use FALSE to fetch updated data.}

\item{write_cache}{(boolean) Write data to cache, defaults to FALSE. Use TRUE to write data to cache for later use. Can also be set using options(hs_write_cache=TRUE)}
}
\value{
Invisibly returns a tibble with weekly and cumulative wildfire emissions data for
the requested place and year. The \code{plt} column identifies the pollutant
(e.g. \code{"CO2"}, \code{"CO"}, \code{"PM2.5"}). Weekly value columns include
\code{curv} (current), \code{minv}, \code{maxv}, and \code{avgv}. Cumulative
columns are prefixed with \code{cum_}.
}
\description{
Retrieves global wildfire greenhouse gas emissions data from the
Global Wildfire Information System (GWIS), operated by the Copernicus
Emergency Management Service.
\url{https://gwis.jrc.ec.europa.eu/apps/gwis.statistics/seasonaltrend}
}
\details{
\code{get_fires_emissions} invisibly returns a tibble with weekly and year-to-date
cumulative wildfire emissions by pollutant, sourced from the GWIS emissions API.
Historical minimum, maximum, and average baselines are included for comparison.
Data coverage begins in 2012. Filter on the \code{plt} column to select a specific
pollutant (e.g. \code{filter(plt == "CO2")}). Cache filenames include the place
and year so that multiple queries can be cached independently.
}
\examples{
\donttest{
# Fetch global emissions data for the current year from cache if available:
emissions <- get_fires_emissions()
#
# Fetch CO2 emissions for the USA in 2023:
emissions_usa <- get_fires_emissions(place = 'USA', year = 2023)
#
# Force cache refresh:
emissions <- get_fires_emissions(use_cache = FALSE)
#
# Review cache contents and last update dates:
hockeystick_cache_details() }

}
\references{
Global Wildfire Information System (GWIS), Copernicus Emergency Management Service / European Commission Joint Research Centre.
\url{https://gwis.jrc.ec.europa.eu/apps/gwis.statistics/seasonaltrend}
}
\author{
Hernando Cortina, \email{hch@alum.mit.edu}
}
