dt2mat: 'data.table' to 'matrix'

dt2matR Documentation

'data.table' to 'matrix'

Description

Convert between 'data.table' and 'matrix'

Usage

dt2mat(x)

mat2dt(x, idvar)

Arguments

x

data.table / matrix

idvar

idvar string

Value

matrix / data.table

Examples

x <- data.table::data.table(
        gene    = c('ENSG001', 'ENSG002', 'ENSG003'),
        sampleA = c(1787, 10, 432),
        sampleB = c(1143,  3, 268))
dt2mat(x)
mat2dt(dt2mat(x), 'gene')

bhagwataditya/importomics documentation built on Nov. 28, 2024, 8:28 a.m.