Learn R Programming

regioneR (version 1.4.0)

toDataframe: toDataframe

Description

Transforms a GRanges object or a data.framecontaining 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)

Value

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

Details

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

See Also

toGRanges

Examples

Run this code
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)

Run the code above in your browser using DataLab