test_that("get_weights_from_table", {
data("idistrib1e4")
tab1 <- idistrib1e4[[1]][1,]
out <- get_weights_from_table(n = 1, x = 0, i_pos = 0)
expect_equal(tab1[1] / sum(tab1), out)
##
n <- 1
x <- 1
tab1 <- idistrib1e4[[n]][x + 1,]
out <- get_weights_from_table(n = n, x = x, i_pos = 0)
expect_equal(tab1[1] / sum(tab1), out)
##
n <- 3
x <- 1
i_pos <- 2
tab1 <- idistrib1e4[[n]][x + 1,]
out <- get_weights_from_table(n = n, x = x, i_pos = i_pos)
expect_equal(tab1[i_pos + 1] / sum(tab1), out)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.