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)

steinbaugh/brio documentation built on Feb. 1, 2024, 6:42 p.m.