library (surveyreader)
library(testthat)
context("Wrapper for time frequency (3 values) Eurobarometer questions.")
test_that("correct conversion takes place", {
expect_equal(rescale_time_frequency_3 (column = c(
"frequently", "occasionally", "never", "NEVER", "NA", "DK")),
c(1,0.5,0,0,NA,NA)
)
expect_equal(rescale_time_frequency_3 (column = c(
"frequently", "occasionally", "Refusal"),
na_labels = "Refusal"),
c(1,0.5,NA)
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.