collectAsSparseMatrix: Converts a tidy dataframe into a Matrix::sparseMatrix

View source: R/dbplyHelper.R

collectAsSparseMatrixR Documentation

Converts a tidy dataframe into a Matrix::sparseMatrix

Description

offloading the majority of processing onto sql if dbplyr tables are involved

Usage

collectAsSparseMatrix(
  df,
  rowVar,
  colVar,
  valueVar = NULL,
  rowNameVar = NULL,
  colNameVar = NULL,
  ...
)

Arguments

df

- a df

rowVar

- the dataframe columns(s) which define the matrix row, quoted by vars(...) - typically this is the observation id

colVar

- the dataframe columns(s) which define the matrix columns, quoted by vars(...) - typically this is the feature id

valueVar

- the name of the value variable. (#TODO could be missing - in which case use binary)

rowNameVar

- (optional) the dataframe column continaing the row names otherwise use rowVar

colNameVar

- (optional) the dataframe column continaing the column names otherwise use colVar

...

- other parameters passes to Matrix::sparseMatrix

Value

a dbplyr dataframe containing the grouped function


terminological/tidy-info-stats documentation built on Nov. 19, 2022, 11:23 p.m.