% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nger_scope.R
\name{cer_nger_scope}
\alias{cer_nger_scope}
\title{Select NGER columns by scope with explicit errors}
\usage{
cer_nger_scope(
  x,
  scope = c("1_plus_2", "1", "2_market", "2_location"),
  col_pattern = NULL
)
}
\arguments{
\item{x}{A \code{cer_tbl} or data frame from \code{\link[=cer_nger_corporate]{cer_nger_corporate()}}.}

\item{scope}{One of \code{"1_plus_2"} (default), \code{"1"}, \code{"2_market"},
or \code{"2_location"}.}

\item{col_pattern}{Optional regex override for the target column.}
}
\value{
A data frame with an \code{emissions_t_co2e} column populated
by the requested scope and a \code{scope} column recording which
scope was selected.
}
\description{
Given an NGER corporate-level data frame from
\code{\link[=cer_nger_corporate]{cer_nger_corporate()}}, select the requested scope columns and
error if they are not present. Avoids the silent-misaggregation
failure mode where a user sums a column that is actually Scope
1+2 combined when they intended Scope 1 only.
}
\details{
Column-name detection is heuristic because NGER renames columns
year to year. Pass \code{col_pattern} to override.
}
\examples{
\donttest{
op <- options(cer.cache_dir = tempdir())
try({
  x <- cer_nger_corporate(2025)
  cer_nger_scope(x, scope = "1")
})
options(op)
}
}
\seealso{
Other nger: 
\code{\link{cer_nger_climate_active}()},
\code{\link{cer_nger_corporate}()},
\code{\link{cer_nger_electricity}()}
}
\concept{nger}
