tests/testthat/test-rescale_direction.R

library (surveyreader)
library(testthat)
context("Wrapper for direction of country/EU question.")

test_that("correct conversion takes place", {
  expect_equal(rescale_direction  (
    column = c("In the right direction",
               "Things are going in the wrong direction",
               "In the wrong direction",
               "Thins are going in the right direction",
               "Neither the one or the other (SPONTANEOUS)",
               "Inap. (not 1 in eu28)", "DK")),
    c( 1, -1, -1,  1,  0, NA, NA)
  )
})
antaldaniel/surveyreader documentation built on May 16, 2019, 2:29 a.m.