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
I created this function for the DETECT 5-week pilot analysis. It's probably worth adding to bfuncs for future use. Just don't have time to do it now.
merge_like_variables <- function(.data, .x) { # Setup var <- enquo(.x) %>% quo_name() var_x <- paste(var, "x", sep = ".") %>% rlang::sym() var_y <- paste(var, "y", sep = ".") %>% rlang::sym() # Merge .data %>% mutate( out = case_when( is.na(!!var_x) ~ !!var_y %>% as.character(), # IF .x is missing use .y is.na(!!var_y) ~ !!var_x %>% as.character(), # IF .y is missing use .x !!var_x != !!var_y ~ "conflict", # IF neither missing test for conflict TRUE ~ !!var_x %>% as.character() # IF neither missing and no conflict just use .x ) ) %>% pull(out) }
The text was updated successfully, but these errors were encountered:
mbcann01
No branches or pull requests
I created this function for the DETECT 5-week pilot analysis. It's probably worth adding to bfuncs for future use. Just don't have time to do it now.
The text was updated successfully, but these errors were encountered: