missingness | R Documentation |
This function lets the user calculate the percentage of NAs or missingness in a data.frame. It also plots the results if needed.
missingness(df, plot = FALSE, full = FALSE, subtitle = NA, summary = TRUE)
df |
Dataframe. Dataframe to study |
plot |
Boolean. Do you wish to plot results? |
full |
Boolean. Return all variables (or only with missings)? |
subtitle |
Character. Subtitle to show in plot |
summary |
Boolean. Show numerical summary text? |
data.frame with each variable, number of missing values and percentage.
If plot=TRUE
, a plot with the same information reflected.
Other Exploratory:
corr_cross()
,
corr_var()
,
crosstab()
,
df_str()
,
distr()
,
freqs()
,
freqs_df()
,
freqs_list()
,
freqs_plot()
,
lasso_vars()
,
plot_cats()
,
plot_df()
,
plot_nums()
,
tree_var()
Other Missing Values:
impute()
Sys.unsetenv("LARES_FONT") # Temporal
# Dummy data
df <- data.frame(
A = c(1:5),
B = c(NA, NA, 1, 1, 1),
C = rep(NA, 5),
D = c(NA, LETTERS[1:4])
)
# Missing values summary
missingness(df)
# Visual results
missingness(df, plot = TRUE)
# Show all variables (including those with no missing values)
missingness(df, plot = TRUE, full = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.