coverage_pct: Coverage percentage (1 - mean(is.na)) * 100

View source: R/coverage_pct.R

coverage_pctR Documentation

Coverage percentage (1 - mean(is.na)) * 100

Description

Cpmputes teh coverage percentage for the column/variable of interest.

Usage

coverage_pct(df, by, x, w = NULL, limit = NULL)

Arguments

df

(data frame) Data to analyse

by

(string vector) Variable(s) used for tabulating the variable of interest

x

(string) Variable of interest for which to compute the number of valid (i.e. non-missing) observations

w

(string) Vector of weights

limit

(numeric) Threshold at which, if lower, value will be TRUE

Value

Data frame containing the number of valid (i.e. non-missing) observations for the variable of interest

Examples

data(df_pisa18)
data(df_talis18) 

coverage_pct(df = df_pisa18, by = "cnt",x = "wb173q03ha")
coverage_pct(df = df_talis18, by = "cntry",x = "tt3g01", w = "TCHWGT")

Rrepest documentation built on April 4, 2025, 2:07 a.m.