as.DataFrame: Coerce object to S4 DataFrame

as.DataFrameR Documentation

Coerce object to S4 DataFrame

Description

Coerce object to S4 DataFrame

Usage

as.DataFrame(x, ...)

## S4 method for signature 'GRanges'
as.DataFrame(x)

## S4 method for signature 'IRanges'
as.DataFrame(x)

## S4 method for signature 'Matrix'
as.DataFrame(x)

## S4 method for signature 'SimpleList'
as.DataFrame(x)

## S4 method for signature 'data.frame'
as.DataFrame(x)

## S4 method for signature 'list'
as.DataFrame(x)

## S4 method for signature 'matrix'
as.DataFrame(x)

Arguments

x

Object.

...

Additional arguments.

Value

DataFrame.

Note

Updated 2023-10-06.

Examples

data(GRanges, sparseMatrix, package = "AcidTest")

## `GRanges` to `DFrame` ====
from <- GRanges
to <- as.DataFrame(from)
print(to)

## `Matrix` to `DFrame` ====
from <- sparseMatrix
to <- as.DataFrame(from)
print(to)

## `list` to `DFrame` ====
from <- list(
    "a" = list(c(1, 2), c(3, 4)),
    "b" = list(NULL, NULL)
)
to <- as.DataFrame(from)
print(to)

acidgenomics/pipette documentation built on Jan. 31, 2024, 10:32 p.m.