Learn R Programming

psycCleaning (version 0.1.1)

summarize_missing_values: Count the number of missing values

Description

It counts the number of missing (i.e.,`NA`) values in each column.

Usage

summarize_missing_values(
  data,
  cols = dplyr::everything(),
  group = NULL,
  verbose = TRUE,
  return_result = FALSE
)

Value

An object of the same type as .data. that specified the number of NA values of the columns (only when `return_result = TRUE`)

Arguments

data

A data.frame or a data.frame extension (e.g. a tibble).

cols

Columns that need to be checked for missing values. See `dplyr::dplyr_tidy_select` for available options.

group

character. count missing values by group.

verbose

default is `TRUE`. Print the missing value data frame

return_result

default is `FALSE`. Return `data_frame` if set to yes

Examples

Run this code
df1 = data.frame(col1 = c(1,2,3),col2 = c(1,NA,3),col3 = c(1,2,NA))
summarize_missing_values(df1,everything())

Run the code above in your browser using DataLab