calc_achievement: Calculate Achievement

View source: R/calc_achievement.R

calc_achievementR Documentation

Calculate Achievement

Description

'calc_achievement' creates a target achievement column standard to many PEPFAR analyses. It can calculate achievement from a normal MSD or one reshaped using 'reshape_msd'.

Usage

calc_achievement(df)

Arguments

df

MSD based dataframe

Value

one or two additional columns that calculate achievement and/or quarterly achievement

See Also

[reshape_msd()]

Other achievement: adorn_achievement()

Examples

## Not run: 
df_msd <- read_msd(path)
df_msd_agg <- df_msd %>%
 filter(operatingunit == "Jupiter"
        indicator %in% c("TX_NEW", "TX_CURR"),
        funding_agency != "Dedup",
        standardizeddisaggregate == "Total Numerator") %>%
 group_by(operatingunit, funding_agency, fiscal_year, indicator) %>%
 summarise(across(where(is.double), sum, na.rm = TRUE)) %>%
 ungroup()

calc_achievement(df_msd_agg)

df_msd_agg %>%
 reshape_msd("quarters") %>%
 calc_achievement() 
## End(Not run)

USAID-OHA-SI/gophr documentation built on Nov. 14, 2024, 8:30 p.m.