Skip to content

Commit e5c80f1

Browse files
authored
Merge pull request #930 from cmu-delphi/fb-package-V4a-wording
[fb-survey] Support new wording of V4a "local health" item followup
2 parents 5c74cb6 + 972aa89 commit e5c80f1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

facebook/delphiFacebook/R/variables.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ code_testing <- function(input_data) {
291291
#'
292292
#' @importFrom dplyr coalesce
293293
code_vaccines <- function(input_data) {
294+
wave <- unique(input_data$wave)
295+
assert(length(wave) == 1, "can only code one wave at a time")
296+
294297
if ("V1" %in% names(input_data)) {
295298
# coded as 1 = Yes, 2 = No, 3 = don't know. We assume that don't know = no,
296299
# because, well, you'd know.

facebook/delphiFacebook/tests/testthat/test-variables.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ test_that("household size correctly imputes zeros", {
149149

150150
test_that("vaccine acceptance is correctly coded", {
151151
input_data <- data.frame(
152+
wave = 1,
152153
V1 = c(2, 3, 2, NA, 1, NA),
153154
V3 = c(1, 2, 3, 4, NA, NA)
154155
)

0 commit comments

Comments
 (0)