Skip to contents

This function computes the variance across the specified axis for a sparse matrix.

Usage

sparse_var(E, axis = 1)

Arguments

E

A sparse matrix where rows represent observations and columns represent features.

axis

An integer specifying the axis along which the variance is calculated (1 for rows, 2 for columns).

Value

A numeric vector containing the variance values.