njtierney / naniar

Tidy data structures, summaries, and visualisations for missing data
http://naniar.njtierney.com/
Other
649 stars 54 forks source link

Improve `miss_summary` by providing a nice print method #316

Open njtierney opened 1 year ago

njtierney commented 1 year ago

As discussed with @dicook, The aim with this is provide a ricer overall summary of missingness, providing information on:

This could also be used iteratively so you can run this summary after making changes to missings and see what the impact is.

I think the way to do this is to write a print method for naniar::miss_summary(airquality), which is a function that does nearly every missingness summary. So you still get the underlying data when you do the summary, but it is presented in a really nice way.

runkelcorey commented 1 year ago

Workshopping this.

> naniar::miss_summary(airquality)
153 observations of 6 variables
44 (4.8%) of 918 values are
    * NA
    * -99
    * ""
2   of 6   (33.3%) variables have missing values
252 of 918 (27.5%) observations have missing values

For a 5-number summary, you could add a min/max/median amount of missing values for variables and for cases, but imho a compact print method is preferable. Many of us still work on our laptop, where screen real estate is a premium.

2   of 6   (33.3%) variables have missing values
Missing values are distributed throughout variables:
min median max
2   5      5