toSparseM: Convert the plpData in COO format into a sparse R matrix

Description Usage Arguments Details Value Examples

View source: R/Formatting.R

Description

Converts the standard plpData to a sparse matrix

Usage

1
toSparseM(plpData, population, map = NULL, temporal = F)

Arguments

plpData

An object of type plpData with covariate in coo format - the patient level prediction data extracted from the CDM.

population

The population to include in the matrix

map

A covariate map (telling us the column number for covariates)

temporal

Whether you want to convert temporal data

Details

This function converts the covariate file from ffdf in COO format into a sparse matrix from the package Matrix

Value

Returns a list, containing the data as a sparse matrix, the plpData covariateRef and a data.frame named map that tells us what covariate corresponds to each column This object is a list with the following components:

data

A sparse matrix with the rows corresponding to each person in the plpData and the columns corresponding to the covariates.

covariateRef

The plpData covariateRef.

map

A data.frame containing the data column ids and the corresponding covariateId from covariateRef.

Examples

1
#TODO

hxia/plp-git-demo documentation built on March 19, 2021, 1:54 a.m.