context("brocks")
# html tri ----------------------------------------------------------------
test_that("html_tri", {
ht1 <- html_tri(1:-1)
ht2 <- html_tri(1:-1, symbols = c("up" = "😊", "down" = "😞",
"nochange" = "😐"))
exp_res2 <-
c("<a style='color:green'>😊</a><a>1</a>",
"<a style='color:black'>😐</a><a>0</a>",
"<a style='color:red'>😞</a><a>-1</a>" )
exp_res1 <-
c("<a style='color:green'>▲</a><a>1</a>",
"<a style='color:black'>■</a><a>0</a>",
"<a style='color:red'>▼</a><a>-1</a>")
expect_equal(ht1, exp_res1)
expect_equal(ht2, exp_res2)
})
test_that("misc", {
expect_equal(ac_se(c(TRUE, FALSE)), 0.219089, tolerance = 0.002)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.