inst/unitTests/test_Pairs-class.R

test_Pairs <- function() {
    score <- rnorm(10)
    p <- Pairs(1:10, Rle(1L, 10), score=score, names=letters[1:10])
    checkIdentical(first(p), 1:10)
    checkIdentical(mcols(p)$score, score)
    checkIdentical(p %in% p[1:5], c(rep(TRUE, 5), rep(FALSE, 5)))
    checkIdentical(as.data.frame(p),
                   data.frame(first=first(p), second=second(p), score,
                              names=names(p), stringsAsFactors=FALSE))
    z <- zipup(p)
    first(p) <- Rle(1:10)
    checkIdentical(zipdown(z), p)
}
AdamLeckenby/S4Vectors_Fix documentation built on May 23, 2019, 2:42 p.m.