matrix.aggregate: Aggregates a (sparse) matrix

Description Usage Arguments Value

Description

Uses the slam package rollup function to efficiently aggregate a sparse matrix. Also allows multiple vectors to be used as grouping vars.

Usage

1
matrix.aggregate(mat, grouping.vars, FUN = "sum")

Arguments

mat

A matrix object, can be a sparse matrix

grouping.vars

The grouping elements. Can be a single vector, or a list or data.frame with multiple vectors

The

name of the function to be applied

Value

A list containing a (sparse) matrix and a data.frame with the variables matching the matrix rows


kasperwelbers/network-tools documentation built on May 20, 2019, 7:38 a.m.