inst/unitTests/test_matrix.R

test_bands <- function() {
    mat <- matrix(1:9, 3, 3)
    checkEquals(band(mat, band.no = 2), c(4,8))
    band(mat, band.no = 2) <- c(9,10)
    checkEquals(mat[1,2], 9)
    checkEquals(mat[2,1], 9)
    checkEquals(mat[2,3], 10)
    checkEquals(mat[3,2], 10)
}

Try the bnbc package in your browser

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

bnbc documentation built on Nov. 1, 2018, 2:37 a.m.