Skip to content

Fix pipeline when barrier column is all NAs part 2 #1435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions facebook/delphiFacebook/R/variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,10 @@ code_vaccines <- function(input_data, wave) {
# If the entire column is NA, ifelse() results in a logical vector, not a
# character vector, which confuses split_options; since the result should be
# NA anyway
vaccine_barriers <- as.character(
ifelse(vaccine_barriers == "13", NA_character_, vaccine_barriers)
)
if (any(!is.na(vaccine_barriers))) {
vaccine_barriers <- ifelse(vaccine_barriers == "13", NA_character_, vaccine_barriers)
vaccine_barriers <- split_options(vaccine_barriers)
}

Expand Down Expand Up @@ -786,11 +788,11 @@ code_vaccines <- function(input_data, wave) {
# If the entire column is NA, ifelse() results in a logical vector, not a
# character vector, which confuses split_options; since the result should be
# NA anyway
if (any(!is.na(input_data$V15b))) {
vaccine_barriers <- ifelse(input_data$V15b == "13", NA, input_data$V15b)
vaccine_barriers <- as.character(
ifelse(input_data$V15b == "13", NA, input_data$V15b)
)
if (any(!is.na(vaccine_barriers))) {
vaccine_barriers <- split_options(vaccine_barriers)
} else {
vaccine_barriers <- input_data$V15b
}

input_data$v_vaccine_barrier_eligible_tried <- is_selected(vaccine_barriers, "1")
Expand Down
5 changes: 0 additions & 5 deletions facebook/delphiFacebook/src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// is_selected_cpp
LogicalVector is_selected_cpp(List responses, String target);
RcppExport SEXP _delphiFacebook_is_selected_cpp(SEXP responsesSEXP, SEXP targetSEXP) {
Expand Down