adorn_achievement: Adorn Achievement

Description Usage Arguments Value Examples

View source: R/calc_achievement.R

Description

Function to calculate target achievement (cumulative and/or quarterly) for a standard MSD or one reshaped using reshape_msd() as well as to apply achievement group labels and colors.

Usage

1

Arguments

df

data frame as standrd MSD or one from reshape_msd()

qtr

if using standard MSD, need to provide the most recent quarter, ideally using identifypd(df_msd, pd_type = "quarter")

Value

data frame with achievement values, labels, and colors

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
df_msd <- read_msd(path)
df_msd_agg <- df_msd %>%
 filter(operatingunit == "Jupiter"
        indicator %in% c("TX_NEW", "TX_CURR"),
        fundingagency != "Dedup",
        standardizeddisaggregate == "Total Numerator") %>%
 group_by(operatingunit, fundingagency, fiscal_year, indicator) %>%
 summarise(across(where(is.double), sum, na.rm = TRUE)) %>%
 ungroup()

adorn_achievement(df_msd_agg)

df_msd_agg %>%
 reshape_msd("quarters") %>%
 adorn_achievement()

df_msd_agg %>%
 reshape_msd("quarters", qtrs_keep_cumulative = TRUE) %>%
 adorn_achievement() 
## End(Not run)

ICPI/ICPIutilities documentation built on Aug. 30, 2021, 12:19 p.m.