Skip to contents

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

if (FALSE) {
 calc_growth(110, 100) #should give 10%
 df %>% mutate(z_change = calc_growth(results_cumulative, dplyr::lag(results_cumulative, n = 4)))}