Created
October 8, 2024 01:13
-
-
Save elipousson/c3662524444b2b726a6690660318d14a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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