We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
make_yes_no() and make_yes_no_unknown() functions currently throw away the labels. They need to be changed to be something like this:
make_yes_no()
make_yes_no_unknown()
make_yes_no_unknown <- function(x) { if (is.factor(x) | is.character(x)) { recoded <- factor(dplyr::case_when( str_detect(x, stringr::regex("^yes", ignore_case = TRUE)) == TRUE ~ "Yes", str_detect(x, stringr::regex("^checked", ignore_case = TRUE)) == TRUE ~ "Yes", str_detect(x, stringr::regex("^no", ignore_case = TRUE)) == TRUE ~ "No", str_detect(x, stringr::regex("^unchecked", ignore_case = TRUE)) == TRUE ~ "No", TRUE ~ "Unknown"), levels = c("No", "Yes", "Unknown")) } else if (is.numeric(x) | is.logical(x)) { recoded <- factor(dplyr::case_when(x == 1 ~ "Yes", x == 0 ~ "No", TRUE ~ "Unknown"), levels = c("No", "Yes", "Unknown")) } else { recoded <- x } if(labelVector::is_labelled(x)){ labelVector::set_label(recoded, labelVector::get_label(x)) } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
make_yes_no()
andmake_yes_no_unknown()
functions currently throw away the labels. They need to be changed to be something like this:The text was updated successfully, but these errors were encountered: