RleListToRleMatrix {DEScan2} | R Documentation |
a wrapper to create a RleMatrix from a RleList object.
RleListToRleMatrix(RleList, dimnames = NULL)
RleList |
an RleList object with all elements of the same length. |
dimnames |
the names for dimensions of RleMatrix (see DelayedArray pkg). |
a RleMatrix from DelayedArray package.
library("DelayedArray") lengths <- c(3, 1, 2) values <- c(15, 5, 20) el1 <- S4Vectors::Rle(values=values, lengths=lengths) el2 <- S4Vectors::Rle(values=sort(values), lengths=lengths) rleList <- IRanges::RleList(el1, el2) names(rleList) <- c("one", "two") (rleMat <- RleListToRleMatrix(rleList))