Skip to content

Commit 637d5e7

Browse files
committed
robustify display logic recoding
1 parent 8cfd2d8 commit 637d5e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

facebook/qsf-tools/generate-codebook.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ process_qsf <- function(path_to_qsf,
233233
curr_map <- recode_map[qids == qid][[1]]
234234

235235
if ( !is.null(curr_map) ) {
236-
option_code <- curr_map[names(curr_map) == option_code]
236+
option_code <- ifelse(option_code %in% names(curr_map), curr_map[[which(names(curr_map) == option_code)]], option_code)
237237
}
238238

239239
paste(c(qid, selectable_text, option_code), collapse="")

0 commit comments

Comments
 (0)