Skip to content

Commit 8b5982f

Browse files
authored
Merge pull request #1447 from cmu-delphi/codebook-numeric-wave
[CTIS] Codebook improvements
2 parents 43c9484 + b47b0ee commit 8b5982f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

facebook/qsf-tools/generate-codebook.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ add_qdf_to_codebook <- function(qdf,
350350
} else {
351351
codebook <- read_csv(path_to_codebook, col_types = cols(
352352
.default = col_character(),
353-
wave = col_integer(),
353+
wave = col_double(),
354354
variable = col_character(),
355355
replaces = col_character(),
356356
description = col_character(),
@@ -399,7 +399,7 @@ add_static_fields <- function(codebook,
399399
codebook <- bind_rows(codebook, static_fields) %>%
400400
filter(!(variable == "module" & wave < 11), # module field is only available for wave >= 11
401401
!(variable %in% c("wave", "UserLanguage", "fips") & wave < 4), # wave, UserLangauge, and fips fields are only available for wave >= 4
402-
!(variable == "w12_treatment" & wave == 12.5), # experimental arm field is only available for wave == 12.5
402+
!(variable == "w12_treatment" & wave != 12.5), # experimental arm field is only available for wave == 12.5
403403
variable != "Random_Number"
404404
)
405405

@@ -438,7 +438,7 @@ get_static_fields <- function(wave,
438438
add_qsf_to_codebook <- function(path_to_qsf, path_to_codebook) {
439439
qdf <- process_qsf(path_to_qsf)
440440
codebook <- add_qdf_to_codebook(qdf, path_to_codebook)
441-
write_excel_csv(codebook, path_to_codebook)
441+
write_excel_csv(codebook, path_to_codebook, quote="needed")
442442
}
443443

444444

0 commit comments

Comments
 (0)