Skip to content

Instantly share code, notes, and snippets.

@elipousson
Created October 8, 2024 01:13
Show Gist options
  • Save elipousson/c3662524444b2b726a6690660318d14a to your computer and use it in GitHub Desktop.
Save elipousson/c3662524444b2b726a6690660318d14a to your computer and use it in GitHub Desktop.
test_list <- list(
1,
c(1, 2),
c(2, 3),
c(3, 4),
4,
5
)
map(
test_list,
\(x) {
for (i in test_list) {
if (any(x %in% i)) {
x <- append(x, i)
}
}
sort(unique(x))
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment