USAID-OHA-SI / glamr

SI Utilities
https://usaid-oha-si.github.io/glamr/
Other
2 stars 3 forks source link

Simple function to filter for totals #63

Closed achafetz closed 2 years ago

achafetz commented 2 years ago

Function that just filters total numerator and total denominator in a MSD.

keep_totals_only <- function(df){
  if("standardizeddisaggregate" %in% names(df))
     stop("The provided dataframe is missing standardizeddisaggregate")

  df %>%
    dplyr::filter(standardizeddisaggregate %in% c("Total Numerator", "Total Denominator")

}
achafetz commented 2 years ago

name function pluck_totals() per @tessam30