library (surveyreader)
library(testthat)
context("Convert situation description categories.")
test_that("correct conversion takes place", {
expect_equal(rescale_situation (column =
c("DK",
"Very good",
"Very bad",
"Rather good",
"Rather bad"),
underscore = FALSE,
return_class = "character"),
c(NA ,"very good" ,"very bad" ,
"rather good","rather bad")
)
expect_equal(rescale_situation (column =
c("DK",
"Very good",
"Very bad",
"Rather good",
"Rather bad"),
return_class = "numeric"),
c(NA ,2,-2,1,-1)
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.