test_that("dssRange split works", {
rem <- dssRange('iris', type = 'split')
r1 <- sapply(session1$iris[,1:4], range, simplify = FALSE, USE.NAMES = TRUE)
r2 <- sapply(session2$iris[,1:4], range, simplify = FALSE, USE.NAMES = TRUE)
# are the differences within 5%?
first_term1 <- Map(abs, rem$server1$iris)
first_term2 <- Map(abs, rem$server2$iris)
second_term1 <- Map(abs, r1)
second_term2 <- Map(abs, r2)
small_error1 <- Map('/', Map('-', first_term1, second_term1), second_term1)
small_error2 <- Map('/', Map('-', first_term2, second_term2), second_term2)
expect_true(all(unlist(Map('<',small_error1, 0.05))))
expect_true(all(unlist(Map('<',small_error2, 0.05))))
})
test_that("dssRange combined works", {
rem <- dssRange('iris', type = 'combine', datasources = opals)
r <- sapply(iris[,1:4], range, simplify = FALSE, USE.NAMES = TRUE)
first_term <- Map(abs, rem$global)
second_term <- Map(abs, r)
small_error <- Map('/', Map('-', first_term, second_term), second_term)
expect_true(all(unlist(Map('<',small_error, 0.05))))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.