| addBins {epistack} | R Documentation |
Add an optional bin metadata column to gr,
to serve as annotations
for the epistack plots.
addBins(gr, nbins = 5L, bin = NULL)
gr |
a GRanges object. |
nbins |
an integer number, the number of bins. |
bin |
a vector containing pre-determined bins, in the same
order as |
nbins is taken into account only if bin is NULL.
gr should be sorted first, usually with the
addMetricAndArrangeGRanges()
function. addBin(gr, bin = vec) is equivalent to
gr$bin <- vec, while
addBin(gr, nbins = 5) will create 5 bins of equal size based on
gr
order.
the gr GRanges object with a new bin metadata column
data("stackepi")
addBins(stackepi)
# 3 bins instead of 5
addBins(stackepi, nbins = 3)
# assign bins using a vector
addBins(stackepi, bin = rep(c("a", "b", "c"),
length.out = length(stackepi)))