apply1_sp: Apply for sparse matrix.

View source: R/helpers_sparse_matrix.R

apply1_spR Documentation

Apply for sparse matrix.

Description

Sparse matrix version of the apply function. Avoid errors when working with large matrix. Apply the function on each element or row.

Usage

apply1_sp(X, FUN)

Arguments

X

matrix; data.

FUN

function.

Value

res; the result depends on the function. If the function aggregates, then it will do it by rows and return a vector. If the function does not aggreate, it will return a list with each row.


edroaldo/fusca documentation built on March 1, 2023, 1:43 p.m.