Skip to content

Commit 8576a28

Browse files
committed
cast vaccine_barriers to char
1 parent ad4154d commit 8576a28

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

facebook/delphiFacebook/R/variables.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,9 @@ code_vaccines <- function(input_data, wave) {
646646
# If the entire column is NA, ifelse() results in a logical vector, not a
647647
# character vector, which confuses split_options; since the result should be
648648
# NA anyway
649-
vaccine_barriers <- ifelse(vaccine_barriers == "13", NA_character_, vaccine_barriers)
649+
vaccine_barriers <- as.character(
650+
ifelse(vaccine_barriers == "13", NA_character_, vaccine_barriers)
651+
)
650652
if (any(!is.na(vaccine_barriers))) {
651653
vaccine_barriers <- split_options(vaccine_barriers)
652654
}
@@ -786,7 +788,9 @@ code_vaccines <- function(input_data, wave) {
786788
# If the entire column is NA, ifelse() results in a logical vector, not a
787789
# character vector, which confuses split_options; since the result should be
788790
# NA anyway
789-
vaccine_barriers <- ifelse(input_data$V15b == "13", NA, input_data$V15b)
791+
vaccine_barriers <- as.character(
792+
ifelse(input_data$V15b == "13", NA, input_data$V15b)
793+
)
790794
if (any(!is.na(vaccine_barriers))) {
791795
vaccine_barriers <- split_options(vaccine_barriers)
792796
} else {

facebook/delphiFacebook/src/RcppExports.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55

66
using namespace Rcpp;
77

8-
#ifdef RCPP_USE_GLOBAL_ROSTREAM
9-
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
10-
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
11-
#endif
12-
138
// is_selected_cpp
149
LogicalVector is_selected_cpp(List responses, String target);
1510
RcppExport SEXP _delphiFacebook_is_selected_cpp(SEXP responsesSEXP, SEXP targetSEXP) {

0 commit comments

Comments
 (0)