sparse_matrix_to_tidy: Tidy a sparse matrix

Description Usage Arguments Value

View source: R/spare_matrix_to_tidy_df.R

Description

Tidy a sparse matrix

Usage

1
2
3
4
5
6
7
sparse_matrix_to_tidy(
  sparse_mat,
  rows_id = "x",
  cols_id = "y",
  values_id = "value",
  keep_values = TRUE
)

Arguments

sparse_mat

Sparse matrix of class dgCMatrix or its variants

rows_id

What is stored in the rows of matrix

cols_id

What is stored in the columns on matrix

values_id

What the values in the cells are

keep_values

Do you want to keep the values of the cells or is the matrix a binary one where just existance matters?

Value

Tidy df with a row for each non-empty entry in the sparse matrix. If keep_values == TRUE then there will be a third column containing the value of cell in matrix at pairing.


nstrayer/phewasHelper documentation built on April 2, 2020, 5:06 a.m.