apply2_sp: Apply for sparse matrix.

View source: R/helpers_sparse_matrix.R

apply2_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 column. It is the same as the apply1_sp, but for columns. The matrix is transposed.

Usage

apply2_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.