Nothing
context("Check colSds and rowSds")
x <- matrix(rnorm(50), 10, 5)
dimnames(x) <- list(paste0("r", 1:10), paste0("c", 1:5))
test_that("colSds and rowSds is computed correctly", {
expect_that(apply(x, 1, sd), equals(GMCM:::rowSds(x)))
expect_that(apply(x, 2, sd), equals(GMCM:::colSds(x)))
})
test_that("colSds and rowSds fails as intented", {
expect_error(GMCM:::rowSds(x[, 0]), "col")
expect_error(GMCM:::colSds(x[0, ]), "row")
})
test_that("colSds and rowSds handles zero rows and columns correctly", {
expect_that(GMCM:::rowSds(x[0, ]), equals(apply(x[0,], 1, sd)))
expect_that(GMCM:::colSds(x[, 0]), equals(apply(x[,0], 2, sd)))
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.