toDataframe {regioneR} | R Documentation

## toDataframe

### Description

Transforms a `GRanges` object or a `data.frame`containing a region set into a `data.frame`.

### Usage

    toDataframe(A, stranded=FALSE)

### Arguments

`A` | a `GRanges` object.
`stranded` | (only used when A is a `GRanges` object) a logical indicating whether a column with the strand information have to be added to the result (Defaults to FALSE)

### Details

If the oject is of class `data.frame`, it will be returned untouched.

### Value

A `data.frame` with the regions in A. If A was a `GRanges` object, the output will include any metadata present in A.

### See Also

`toGRanges`

### Examples

    A <- data.frame(chr=1, start=c(1, 15, 24), end=c(10, 20, 30), x=c(1,2,3), y=c("a", "b", "c"))

    A2 <- toGRanges(A)

    toDataframe(A2)

[Package regioneR version 1.16.5 Index]