% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils-scenarios.R
\name{trim_values}
\alias{trim_values}
\title{Trim values}
\usage{
trim_values(
  df,
  col,
  value_col = "value",
  baseline_col = value_col,
  trim = TRUE,
  small_is_best = FALSE,
  keep_better_values = FALSE,
  upper_limit = 100,
  lower_limit = 0,
  trim_years = TRUE,
  start_year_trim = 2018,
  end_year_trim = 2025
)
}
\arguments{
\item{df}{Data frame in long format, where 1 row corresponds to a specific
country, year, and indicator.}

\item{col}{column to trim values from. Will be removed before returning the
data frame.}

\item{value_col}{Column name of column with indicator values. This column will be
used to return the results.}

\item{baseline_col}{Column name with baseline values. This is used to ensure
that trimmed values do not get worst values than baseline.}

\item{trim}{logical to indicate if the data should be trimmed between
\code{upper_limit} and \code{lower_limit}.}

\item{small_is_best}{Logical to identify if a lower value is better than a higher
one (e.g. lower obesity in a positive public health outcome, so obesity rate
should have small_is_best = TRUE).}

\item{keep_better_values}{logical to indicate if "better" values should be
kept from \code{value_col} if they are present. Follows the direction set in
\code{small_is_best}.  For instance, if small_is_best is TRUE, then \code{value_col} lower
than \code{col} will be kept.}

\item{upper_limit}{upper limit at which the indicator should be caped.}

\item{lower_limit}{lower_limit limit at which the indicator should be caped.}

\item{trim_years}{logical to indicate if years before \code{start_year_trim} and after
\code{end_year_trim} should be removed}

\item{start_year_trim}{(integer) year to start trimming from.}

\item{end_year_trim}{(integer) year to end trimming.}
}
\value{
trimed data frame, removing the \code{col} column, and putting the trimmed
values in \code{value_col}
}
\description{
Trim values
}
\seealso{
General scenario functions
\code{\link{add_scenario}()},
\code{\link{calculate_aarc}()},
\code{\link{calculate_aroc}()},
\code{\link{exec_scenario}()},
\code{\link{fill_cols_scenario}()},
\code{\link{flat_extrapolation}()},
\code{\link{get_aarr}()},
\code{\link{get_baseline_value}()},
\code{\link{get_baseline_year}()},
\code{\link{get_last_value}()},
\code{\link{get_last_year_scenario}()},
\code{\link{get_latest_aarc}()},
\code{\link{get_percent_change_aarc}()},
\code{\link{get_target_aarc}()},
\code{\link{remove_unwanted_scenarios}()},
\code{\link{trim_years}()}
}
\concept{scenarios}
\keyword{internal}
