% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sparse_matrix_tools.R
\name{collapse_sparse_rows}
\alias{collapse_sparse_rows}
\title{Collapse sparse matrix rows by group}
\usage{
collapse_sparse_rows(matrix, group)
}
\arguments{
\item{matrix}{A sparse matrix.}

\item{group}{A vector defining the output row groups.}
}
\value{
A sparse matrix with rows collapsed by `group`.
}
\description{
Collapse sparse matrix rows by group
}
\examples{
mat <- Matrix::Matrix(
  matrix(c(1, 0, 2, 0, 3, 4), nrow = 3, byrow = TRUE),
  sparse = TRUE
)
collapse_sparse_rows(mat, c("g1", "g1", "g2"))
}
