library (surveyreader)
library(testthat)
context("Convert description trend variables.")
test_that("correct conversion takes place", {
expect_equal(rescale_description (column =
c("Very well",
"Fairly well",
"Fairly badly",
"Very badly",
"DK", "NA"),
underscore = FALSE,
return_class = "character"),
c("very_well", "fairly_well",
"fairly_badly", "very_badly",NA, NA)
)
expect_equal(rescale_description (column =
c("Very well",
"Fairly well",
"Fairly badly",
"Very badly",
"DK", "NA"),
return_class = "numeric"),
c(2,1,-1,-2,NA,NA)
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.