Skip to contents

This function checks the sparsity of a design matrix and provides a recommendation if the matrix is considered sparse.

Usage

check_design_matrix_sparsity(
  matrix,
  sparsity_threshold = 0.9,
  min_matrix_size = 50,
  name = "checked"
)

Arguments

matrix

A numeric matrix to be checked for sparsity.

sparsity_threshold

A numeric value between 0 and 1 indicating the threshold for considering a matrix sparse. Default is 0.9.

min_matrix_size

An integer indicating the minimum size of the matrix for which to perform the sparsity check. Default is 50.

name

A character string specifying the name of the design matrix. Default is "checked".

Value

This function is used for its side effect of providing an informational message if the matrix is sparse. It returns NULL invisibly.