identifypd: Extract Current Reporting Period

View source: R/identifypd.R

identifypdR Documentation

Extract Current Reporting Period

Description

'identifypd' uses the information from the raw MSD structure to identify the current reporting period (fiscal year and/or quarter). This function can be used to make other inputs in your code more dynamic. Originally, 'identifypd' was developed for use in achafetz/PartnerProgress

Usage

identifypd(df, pd_type = "full", pd_prior = FALSE)

Arguments

df

dataset to use to find latest period

pd_type

what is returned? (a) full, eg fy2018q1; (b)year, eg 2018; (c) quarter, eg 1

pd_prior

do you want the last period returned (instead of the current); default = FALSE

Examples

## Not run: 
#return full, current period, eg "fy2018q3"
identifypd(df_mer)
#return the current quarter, eg 3
identifypd(df_mer, "quarter")
#return the prior quarter, eg "fy2018q2"
identifypd(df_mer, pd_prior = TRUE)
  
## End(Not run)


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