Created
May 20, 2022 18:03
-
-
Save luisDVA/4d463e7a447afa994b7bbef5bf7de45f to your computer and use it in GitHub Desktop.
problema_map
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
# lista 1 | |
dat1a <- tibble(id=c("A","B","C","D","E"),val=rnorm(5)) | |
dat1b <- tibble(id=c("A","B","C","D","E"),val=rnorm(5)) | |
dat1 <- list(dat1a,dat1b) | |
dat1 | |
# lista dos | |
dat2a <- tibble(id=c("A","D","E"),label=rnorm(3)) | |
dat2b_1 <- tibble(id=c("A","B","C","E"),label=rnorm(4)) | |
dat2b_2 <- tibble(id=c("B","C","D","E"),label=rnorm(4)) | |
dat2 <- list(list(dat2a),list(dat2b_1,dat2b_2)) | |
dat1 | |
dat2 | |
# resultado esperado | |
list( | |
map2(dat1[1],dat2[[1]],left_join), | |
map2(dat1[2],dat2[[2]],left_join) | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment