missing_values: Find missing values

Description Usage Arguments Value See Also Examples

Description

This utility function finds and counts any NA values in each variable of a data frame.

Usage

1
missing_values(dt, sorted = TRUE)

Arguments

dt

A vector, matrix, data frame or S3 object of mim class.

sorted

A logical scalar value. Do you want to sort the results? Default = TRUE.

Value

A named numeric. Names are the column names if the input is a data frame, column numbers for a matrix or index positions if a vector. Values are the count of NA found in that variable

See Also

missing_matrix

Examples

1
2
3
4
missing_values(c(1, 1, 1, NA, NA, 1))
missing_values(matrix(c(1, 1, NA, NA), ncol = 2))
missing_values(data.frame(x = c("foo", NA, NA), y = c(NA, "bar", "bar")))
missing_values(data.frame(x = c("foo", NA, NA), y = c(NA, "bar", "bar")), sorted = FALSE)

julianhatwell/arulesimp documentation built on May 11, 2019, 4:17 p.m.