`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

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

if (FALSE) {
#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)
  }