summarize_ndr: Count the Number of Outcomes Based on a Specified Level

View source: R/summarize_ndr.R

summarize_ndrR Documentation

Count the Number of Outcomes Based on a Specified Level

Description

The summarize_ndr() function counts the number of occurrence of specified level for each of the supplied dataframe. It then combines the given dataframes into a single table. It also adds a "Total" roll that adds all the rows for each of the numeric columns.

Usage

summarize_ndr(..., level = "state", names = NULL)

Arguments

...

Dataframes to be summarized.

level

The level at which the summary should be performed. The options are "ip" (or "country"), "state", "lga" or "facility".

names

The names to be passed to the summary columns created in the output

Value

summarize_ndr

Examples

new <- tx_new(ndr_example, from = "2021-03-01")
curr <- tx_curr(ndr_example)

summarize_ndr(
  new,
  curr,
  level = "state",
  names = c("tx_new", "tx_curr")
)

### summarize for only one dataframe (defaults data name when name is not specified)
summarize_ndr(
  data = new,
  level = "ip"
)

tidyndr documentation built on April 8, 2022, 9:06 a.m.