toMatrix: Turn a two-columns mapping table to matrix

Description Usage Arguments Details Value See Also Examples

View source: R/matrix.R

Description

Generate the sparse mapping matrix from a two-columns table.

Usage

1
toMatrix(table, rows = unique(table[, 1]), cols = unique(table[, 2]))

Arguments

table

The two-columns table as matrix or data frame. The other columns will not be used, if available.

rows

The row names for the mapping matrix.

cols

The column names for the mapping matrix.

Details

This function generates the sparse logical matrix from the two-columns table returned by toTable in Bioconductor package AnnotationDbi.

Value

This function returns a sparse logical matrix.

See Also

toTable

Examples

1
2
3
4
5
6
7
## Not run: 
if (!requireNamespace("BiocManager"))
  install.packages("BiocManager")
BiocManager::install("org.Hs.eg.db")
x <- toMatrix(toTable(org.Hs.egGO2ALLEGS))

## End(Not run)

wulingyun/CopTea documentation built on Dec. 4, 2019, 2:59 p.m.