Combine V15a/c logic properly for survey Wave 12 #1439
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Since items V15a and V15c won't be available at the same time for a given data file, combine their
ifblocks into one so that only one of the conditions is triggered per data file.Changelog
variables.R: Changeifblocks that depend on item V15c (if ( all(c("V15c", "V15b") %in% names(input_data)) )andif ( "V15c" %in% names(input_data) )) toelse if.Fixes
error introduced in #1303.
When item V15a exists, as in Wave 11 data,
vaccine_barrier_*andvaccine_barrier_*_hasfields were created in an initialifblock. A secondifblock checked for the existence of item V15c (replacing V15a as of Wave 12) and if not found, overwrote those fields withNA. Since the existence of V15a and V15c were checked separately, the V15celsecondition was always triggered, resulting in thevaccine_barrier_*andvaccine_barrier_*_hasfields always being completely missing for pre-Wave 12 survey versions and the relevant indicators not being reported.We'll need to reissue the
smoothed_wvaccine_barrier_*andsmoothed_wvaccine_barrier_*_hasindicators back to Dec 12.