trip2sparseMatrix: Convert a table-style sparse matrix representation to a...

Description Usage Arguments Value

View source: R/utils.R

Description

Convert a table-style sparse matrix representation to a sparse matrix

Usage

1
2
3
4
5
6
7
8
9
trip2sparseMatrix(
  rowname_vals,
  colname_vals,
  values = rep(1, length(colname_vals)),
  total_rownames = unique(rowname_vals),
  total_colnames = unique(colname_vals),
  add_intercept = TRUE,
  csr = FALSE
)

Arguments

rowname_vals

vector with the rownames of the values

colname_vals

vector with the colnames of the values

values

the values themselves (default is 1.0)

total_rownames

the universe of rownames, defaults to all the unique rowname_vals

total_colnames

the universe of colnames, defaults to all the unique colname_vals

add_intercept

whether to add an intercept term ("Intercept" will be added to total_colnames)

Value

a sparse matrix of dim(length(total_rownames),length(total_colnames)) with (at most) length(values) non-zero values


CreRecombinase/FGEM documentation built on July 17, 2020, 5:30 a.m.