tests/testthat/test-make_binary_word.R

test_that("binary_word_basic", {
  
  test_df <- data.frame(
    q1 = c("Unchecked", "Checked"),
    q2 = c("Unchecked", "Unchecked"),
    q3 = c("Checked", "Checked"),
    q4 = c("Checked", "Unchecked"),
    stringsAsFactors = FALSE
  )
  
  expect_equal(
    make_binary_word(test_df),
    c("__cd", "a_c_")
  )
  
})

Try the tidyREDCap package in your browser

Any scripts or data that you put into this service are public.

tidyREDCap documentation built on May 31, 2023, 7:03 p.m.