File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
facebook/delphiFacebook/R Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -544,6 +544,12 @@ create_complete_responses <- function(input_data, county_crosswalk)
544
544
" zip5" # temporarily; we'll filter by this column later and then drop it before writing
545
545
)
546
546
547
+ # Remove "raceethnicity" from cols_to_report if not producing race-ethnicity
548
+ # microdata so we don't get an error that the field doesn't exist.
549
+ if (is.null(params $ produce_individual_raceeth ) || ! params $ produce_individual_raceeth ) {
550
+ cols_to_report <- cols_to_report [cols_to_report != " raceethnicity" ]
551
+ }
552
+
547
553
# Not all cols are present in all waves; if our data does not include some
548
554
# questions, don't report them.
549
555
if (any(! (cols_to_report %in% names(input_data )))) {
You can’t perform that action at this time.
0 commit comments