Learn R Programming

plyranges (version 1.9.3)

bind_ranges: Combine Ranges by concatentating them together

Description

Combine Ranges by concatentating them together

Usage

bind_ranges(..., .id = NULL)

Arguments

...

Ranges objects to combine. Each argument can be a Ranges object, or a list of Ranges objects.

.id

Ranges object identifier. When .id is supplied a new column is created that links each row to the original Range object. The contents of the column correspond to the named arguments or the names of the list supplied.

Value

a concatenated Ranges object

Examples

Run this code
# NOT RUN {
gr <- as_granges(data.frame(start = 10:15,
                            width = 5,
                            seqnames = "seq1"))
gr2 <- as_granges(data.frame(start = 11:14,
                            width = 1:4,
                            seqnames = "seq2"))
bind_ranges(gr, gr2)

bind_ranges(a = gr, b = gr2, .id = "origin")

bind_ranges(gr, list(gr, gr2), gr2)

bind_ranges(list(a = gr, b = gr2), c = gr, .id = "origin")

# }

Run the code above in your browser using DataLab