Skip to contents

compute_completion_rate() computes the percentage of non-missing values.

Usage

compute_completion_rate(data, id_vars = NULL, digits = 2)

Arguments

data

A tibble.

id_vars

A character vector of variable names indicating the groups over which counting of the NA should be performed. Default to NULL indicating that no groups should be used.

digits

The digits argument passed to signif().

Value

A tibble.

Examples

if (FALSE) {
tbl <- build_tbl(
  "tb",
  year = 2019,
  estimated = "who_estimates.e_inc_num",
  notified = "who_notifications.c_newinc",
  vars = extract_vars("tb")
)
compute_completion_rate(tbl, id_vars = c("year", "is_hbc"))

cars_df <- tibble::as_tibble(mtcars, rownames = "car_name")
compute_completion_rate(cars_df, id_vars = NULL)
}