View source: R/epi_stats_na_perc.R
epi_stats_na_perc | R Documentation |
epi_stats_na_perc() gets the total counts and percentage for missing values across rows or columns
epi_stats_na_perc(df = NULL, margin = 2)
df |
A dataframe with missing values |
margin |
2 for columns, 1 for rows. Default is columns |
A dataframe object with counts and percentage of NAs for each column or row.
Antonio J Berlanga-Taylor <\url{https://github.com/AntonioJBT/episcout}>
complete.cases
## Not run:
library(mice)
dim(nhanes)
epi_head_and_tail(nhanes, cols = 4)
# Get summary of counts and percentages for missing values across columns:
na_cols <- epi_stats_na_perc(nhanes, margin = 2)
na_cols
# Get summary of counts and percentages for missing values across rows:
na_rows <- epi_stats_na_perc(nhanes, margin = 1)
epi_head_and_tail(na_rows, cols = 2)
summary(na_rows)
length(which(na_rows$na_counts == 0))
# which should be equal to:
length(which(complete.cases(nhanes)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.