% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/load_gerda_web.R
\name{load_gerda_web}
\alias{load_gerda_web}
\title{Load GERDA Data}
\usage{
load_gerda_web(
  file_name,
  verbose = FALSE,
  file_format = "rds",
  on_error = getOption("gerda.on_error", "warn")
)
}
\arguments{
\item{file_name}{A character string specifying the name of the file to load. For a list of available data, see \code{\link{gerda_data_list}}.}

\item{verbose}{A logical value indicating whether to print additional messages to the console. Default is FALSE.}

\item{file_format}{A character string specifying the format of the file. Must be either "csv" or "rds". Default is "rds".}

\item{on_error}{How to handle errors (unknown dataset name, failed download, corrupt file, invalid \code{file_format}). Either \code{"warn"} (default) to emit a warning and return \code{NULL}, or \code{"stop"} to raise an error. Use \code{"stop"} inside scripts or pipelines where silent \code{NULL} returns would produce confusing downstream failures. The global default can also be overridden with \code{options(gerda.on_error = "stop")}.}
}
\value{
A tibble containing the loaded data, or NULL if the data could not be loaded.
}
\description{
This function loads GERDA data from a web source.
}
\section{Vote-share columns}{

Election datasets expose one column per party (e.g. \code{cdu}, \code{spd}, \code{gruene}, \code{afd}).
These columns hold the party's share of valid votes and are expressed as
fractions of 1. They do \strong{not} sum to 1 across the named major parties:
the remainder is held by smaller parties with their own columns and, at
the tail, an \code{other} category. For example, in \code{federal_cty_harm} for 2021,
\code{cdu + csu + spd + gruene + fdp + linke_pds + afd} is typically around
0.91 and ranges roughly 0.78 to 0.97 across counties. To reconstruct a
full 1.0 share, include every party column or use \code{other} together with
turnout and invalid-vote columns.
}

\examples{
\donttest{
# Load harmonized municipal elections data
data_municipal_harm <- load_gerda_web("municipal_harm", verbose = TRUE, file_format = "rds")

# Load federal election data harmonized to 2025 boundaries (includes 2025 election)
data_federal_2025 <- load_gerda_web("federal_muni_harm_25", verbose = TRUE, file_format = "rds")
}

}
