Created
August 4, 2022 23:19
-
-
Save brshallo/9c64e80fffb5120ca5e4f38dc4aa79b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
c_sort_collapse <- function(...){ | |
c(...) %>% | |
sort() %>% | |
paste(collapse = ".") | |
} | |
unique_combs <- function(...){ | |
list(...) %>% | |
purrr::pmap_chr(c_sort_collapse) %>% | |
unique() | |
} | |
unique_combs(c("a", "b", "a"), c("a", "a", "b")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment