sparsity: Checks the sparsity of each column of a dataframe, matrix, or...

Description Usage Arguments Value Examples

View source: R/helper_functions.R

Description

Checks the sparsity of each column of a dataframe, matrix, or sparse matrix.

Usage

1
sparsity(input, count.na.zero = FALSE)

Arguments

input

Dataframe, matrix, or sparse matrix.

count.na.zero

Logical. Should NAs be counted as zeros?

Value

Dataframe with the respective column names and sparsity.

Examples

1
2
df <- data.frame(a = c(0, 0, 1), b = c(1, 1, 0), c = c(0, 0, 0))
sparsity(df)

dmolitor/umbrella documentation built on Nov. 10, 2020, 1:25 a.m.