library (surveyreader)
library(testthat)
context("Convert 4-level low-strong categories.")
test_that("correct conversion takes place", {
expect_equal( rescale_low_strong_4 (column =
c("DK",
"Not at all",
"Low",
"Medium",
"Strong"),
underscore = FALSE,
return_class = "character"),
c(NA, "none", "low",
"medium", "strong")
)
expect_equal(rescale_low_strong_4 (column =
c("DK",
"Not at all",
"Low",
"Medium",
"Strong"),
return_class = "numeric"),
c(NA,0,1,2,3)
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.