library (surveyreader)
library(testthat)
context("Wrapper for 3-level amount evalution Eurobarometer questions.")
test_that("correct conversion takes place", {
expect_equal(rescale_amount_3 (column = c("Too much",
"About the right amount",
"Too little",
"NA", "DK")),
c(1,0,-1,NA,NA)
)
expect_equal(rescale_amount_3(column =
c("Too much",
"About the right amount",
"Too little",
"NA", "DK"),
na_labels = "default",
return_class = "character"),
c("too_much", "right_amount", "too_little",NA, NA)
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.