% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/calculate_hpop_contributions.R
\name{calculate_hpop_contributions}
\alias{calculate_hpop_contributions}
\title{Calculate HPOP Indicator Contributions}
\usage{
calculate_hpop_contributions(
  df,
  start_year = 2018,
  end_year = 2019:2025,
  transform_value_col = "transform_value",
  contribution_col = stringr::str_replace(transform_value_col, "transform_value",
    "contribution"),
  contribution_pct_col = paste0(contribution_col, "_percent"),
  contribution_pct_total_pop_col = paste0(contribution_col, "_percent_total_pop"),
  scenario_col = NULL,
  ind_ids = billion_ind_codes("hpop")
)
}
\arguments{
\item{df}{Data frame in long format, where 1 row corresponds to a specific
country, year, and indicator.}

\item{start_year}{Base year for contribution calculation, defaults to 2018.}

\item{end_year}{End year(s) for contribution calculation, defaults to 2019 to 2025.}

\item{transform_value_col}{Column name of column(s) with transformed indicator values,
used to calculate contributions.}

\item{contribution_col}{Column name of column(s) to store contribution (population)
values. Must be the same length as \code{transform_value_col}.}

\item{contribution_pct_col}{Column name of column(s) to store contribution (percent)
values. Must be the same length as \code{transform_value_col}.}

\item{contribution_pct_total_pop_col}{Column name of column(s) to store contribution
(percent of total population of the country) values. Must be the same length
as \code{transform_value_col}.}

\item{scenario_col}{Column name of column with scenario identifiers. Useful for
calculating contributions on data in long format rather than wide format.}

\item{ind_ids}{Named vector of indicator codes for input indicators to the Billion.
Although separate indicator codes can be used than the standard, they must
be supplied as a named vector where the names correspond to the output of
\code{billion_ind_codes()}.}
}
\value{
Data frame in long format.
}
\description{
\code{calculate_hpop_contributions()} calculates indicator-level contributions and
changes for the HPOP Billion.
}
\details{
For more details on the HPOP Billion calculation process and how this function
ties in with the rest, see the vignette:

\href{../doc/hpop.html}{\code{vignette("hpop", package = "billionaiRe")}}
}
\seealso{
Other hpop: 
\code{\link{add_hpop_populations}()},
\code{\link{calculate_hpop_billion_change}()},
\code{\link{calculate_hpop_billion}()},
\code{\link{hpop_df}},
\code{\link{transform_hpop_data}()},
\code{\link{transform_hpop_single}()},
\code{\link{untransform_hpop_data}()},
\code{\link{untransform_hpop_single}()}
}
\concept{hpop}
