Learn R Programming

naniar (version 1.1.0)

gg_miss_fct: Plot the number of missings for each variable, broken down by a factor

Description

This function draws a ggplot plot of the number of missings in each column, broken down by a categorical variable from the dataset. A default minimal theme is used, which can be customised as normal for ggplot.

Usage

gg_miss_fct(x, fct)

Value

ggplot object depicting the % missing of each factor level for each variable.

Arguments

x

data.frame

fct

column containing the factor variable to visualise

See Also

geom_miss_point() gg_miss_case() gg_miss_case_cumsum gg_miss_span() gg_miss_var() gg_miss_var_cumsum() gg_miss_which()

Examples

Run this code

gg_miss_fct(x = riskfactors, fct = marital)
if (FALSE) {
library(ggplot2)
gg_miss_fct(x = riskfactors, fct = marital) + labs(title = "NA in Risk Factors and Marital status")
}

Run the code above in your browser using DataLab