diff --git a/facebook/delphiFacebook/R/variables.R b/facebook/delphiFacebook/R/variables.R index 5fefc7296..0fb47e755 100644 --- a/facebook/delphiFacebook/R/variables.R +++ b/facebook/delphiFacebook/R/variables.R @@ -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) } @@ -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") diff --git a/facebook/delphiFacebook/src/RcppExports.cpp b/facebook/delphiFacebook/src/RcppExports.cpp index e21e5728d..b0056334a 100644 --- a/facebook/delphiFacebook/src/RcppExports.cpp +++ b/facebook/delphiFacebook/src/RcppExports.cpp @@ -5,11 +5,6 @@ using namespace Rcpp; -#ifdef RCPP_USE_GLOBAL_ROSTREAM -Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); -Rcpp::Rostream& 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) {