Learn R Programming

tidyndr (version 0.2.1)

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

Description

The summarise_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

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

Arguments

...

Data frames to be summarised.

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

summarise_ndr

Examples

Run this code
# NOT RUN {
new <- tx_new(ndr_example, from = "2021-03-01")
curr <- tx_curr(ndr_example)

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

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

Run the code above in your browser using DataLab