missing_pairs: Missing values pairs plot

Description Usage Arguments Value Examples

View source: R/missing_plot.R

Description

Compare the occurence of missing values in all variables by each other. Suggest limit the number of variables to a maximum of around six. Dependent and explanatory are for convenience of variable selection, are optional, and have no other specific function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
missing_pairs(
  .data,
  dependent = NULL,
  explanatory = NULL,
  use_labels = TRUE,
  title = NULL,
  position = "stack",
  showXAxisPlotLabels = TRUE,
  showYAxisPlotLabels = FALSE
)

Arguments

.data

Data frame.

dependent

Character vector. Optional name of dependent variable.

explanatory

Character vector. Optional name(s) of explanatory variables.

use_labels

Use variable label names in plot labelling.

title

Character vector. Optional title for plot.

position

For discrete variables, choose "stack" or "fill" to show counts or proportions.

showXAxisPlotLabels

Show x-axis plot labels.

showYAxisPlotLabels

Show y-axis plot labels.

Value

A plot matrix comparing missing values in all variables against each other.

Examples

1
2
3
4
5
6
7
## Not run: 
explanatory = c("age", "nodes", "age.factor", "sex.factor", "obstruct.factor", "perfor.factor")
dependent = 'mort_5yr'
colon_s %>%
  missing_pairs(dependent, explanatory)

## End(Not run)

Example output

Registered S3 method overwritten by 'GGally':
  method from   
  +.gg   ggplot2
Warning messages:
1: Removed 18 rows containing non-finite values (stat_boxplot). 
2: Removed 18 rows containing non-finite values (stat_boxplot). 
3: Removed 18 rows containing non-finite values (stat_boxplot). 
4: Removed 18 rows containing non-finite values (stat_boxplot). 
5: Removed 18 rows containing non-finite values (stat_boxplot). 
6: Removed 18 rows containing non-finite values (stat_boxplot). 
7: Removed 18 rows containing non-finite values (stat_boxplot). 

finalfit documentation built on June 11, 2021, 5:17 p.m.