reshape_msd: Reshape Semi-Wide MSD

Description Usage Arguments Examples

View source: R/reshape_msd.R

Description

Reshape Semi-Wide MSD

Usage

1
2
3
4
5
6
reshape_msd(
  df,
  direction = c("long", "wide", "semi-wide", "quarters"),
  clean = TRUE,
  qtrs_keep_cumulative = FALSE
)

Arguments

df

MSD dataset in the semi-wide format

direction

direction of reshape, "long" (default), "wide" (original MSD structure), "semi-wide" (one column for targets, cumulative, results) or "quarters" (quarters pivoted, but not targets - useful for quarterly achievement))

clean

clean period for graphing, eg(fy2019qtr2 -> FY19Q2) and create a period type (targets, results, cumulative)

qtrs_keep_cumulative

whether to keep the cumulative column when using quaters for direction, default = FALSE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
 #read in data
  df_genie <- match_msd("~/Downloads/PEPFAR-Data-Genie-PSNUByIMs-2018-08-15.zip")
 #reshape long
  df_genie_long <- reshape_msd(df_genie)
 #reshape wide (to look like old format)
  df_genie_long <- reshape_msd(df_genie, direction = "wide")
 #reshape semi-wide (one column for targets, cumulative, results)
  df_genie_wide <- reshape_msd(df_genie, direction = "semi-wide")
 #reshape quarters (quarters pivoted, but not targets - useful for quarterly achievement)
  df_genie_wide <- reshape_msd(df_genie, direction = "semi-wide")
  
## End(Not run)

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