library (surveyreader)
library(testthat)
context("Convert two-level benefit categories.")
test_that("correct conversion takes place", {
expect_equal(rescale_yes_no_2 (column =c("DK",
"Yes",
"No"),
underscore = FALSE,
return_class = "character"),
c(NA, "yes", "no")
)
expect_equal(rescale_yes_no_2 (column =c("DK","Yes",
"No"),
return_class = "numeric"),
c(NA, 1, 0)
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.