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)
    second(p) <- as.integer(second(p))
    checkIdentical(zipdown(z), p)
}

Try the S4Vectors package in your browser

Any scripts or data that you put into this service are public.

S4Vectors documentation built on Dec. 11, 2020, 2:02 a.m.