as {CoreGx}R Documentation

LongTable to data.table conversion

Description

Coerce a LongTable into a data.table.

S3 version of coerce method for convenience.

Currently only supports coercing to data.table or data.frame

S3 version of coerce method fro convenience.

Coerce a data.table with the proper configuration attributes back to a LongTable

Usage

## S3 method for class 'long.table'
as.data.table(from)

## S3 method for class 'long.table'
as.data.frame(x, row.names, optional = TRUE, ...)

Arguments

from

LongTable object coerce to a SummarizedExperiment. Assays are converted to BumpyMatrixes to allow treatment combination support and integration with the gDR package.

x

LongTable to coerce to data.frame.

row.names

An optional character vector of rownames. We do not recommend using this parameter, it is included for S3 method consistency with as.data.frame.

optional

logical Is it optional for row and column names to be valid R names? If FALSE will use the make.names function to ensure the row and column names are valid R names. Defaults to TRUE.

...

Does nothing.

Value

A data.table with the data from a LongTable.

A data.table containing the data from the LongTable, as well as the ‘longTableDataMapper’ attribute which contains the data needed to reverse the coercion.

data.table containing the data from the LongTable, with the ‘longTableDataMapper’ attribute containg the metadata needed to reverse the coercing operation.

data.frame containing the data from the LongTable, with the ‘longTableDataMapper’ attribute containg the metadata needed to reverse the coercion operation.

LongTable object configured with the longTableDataMapper

data.table with long format of data in from

data.frame with long format of data in from.

SummarizedExperiment with each assay as a BumpyMatrix

See Also

BumpyMatrix::BumpyMatrix

Examples

as(merckLongTable, 'data.table')

as(merckLongTable, 'data.frame')

dataTable <- as(merckLongTable, 'data.table')
print(attr(dataTable, 'longTableDataMapper')) # Method doesn't work without this
as(dataTable, 'LongTable')

SE <- molecularProfilesSlot(clevelandSmall_cSet)[[1]]
as(SE, 'data.table')

SE <- molecularProfilesSlot(clevelandSmall_cSet)[[1]]
as(SE, 'data.frame')


[Package CoreGx version 1.6.0 Index]