calc_growth: Calculate growth between two metrics that are positive

View source: R/calc_growth.R

calc_growthR Documentation

Calculate growth between two metrics that are positive

Description

Helper function for calculating growth. Returns NA_real_ if the

Usage

calc_growth(x, y)

Arguments

x

numerator to calculate growth - most recent metric

y

denominator to calculate growth - lagged metric

See Also

Other MDB helper functions: format_indicator(), label_aggregation(), make_achv_shape(), make_chg_shape()

Examples

## Not run: 
 calc_growth(110, 100) #should give 10%
 df %>% mutate(z_change = calc_growth(results_cumulative, dplyr::lag(results_cumulative, n = 4)))
## End(Not run)


USAID-OHA-SI/selfdestructin5 documentation built on Feb. 23, 2025, 5:08 a.m.