Olá, pessoal. Tudo bem?
Uma dúvida que pode ser interessante para outros casos. Suponha que tenha a seguinte lista:
list(tibble::tribble(~colA, ~colB, "a", "a", "b", "1", "c", "c",
"d", "2", "e", "3", "f", "f", "g", "4", "h", "5", "i", "i"),
tibble::tribble(~colA, ~colB, "a", "a", "b", "1", "c", "c",
"d", "2", "e", "3", "f", "f", ))
#> [[1]]
#> # A tibble: 9 x 2
#> colA colB
#> <chr> <chr>
#> 1 a a
#> 2 b 1
#> 3 c c
#> 4 d 2
#> 5 e 3
#> 6 f f
#> 7 g 4
#> 8 h 5
#> 9 i i
#>
#> [[2]]
#> # A tibble: 6 x 2
#> colA colB
#> <chr> <chr>
#> 1 a a
#> 2 b 1
#> 3 c c
#> 4 d 2
#> 5 e 3
#> 6 f f
Created on 2021-03-03 by the reprex package (v0.3.0)
Eu gostaria de filtrar as linhas que são iguais e ficar com uma lista assim:
list(tibble::tribble(~colA, ~colB, "b", "1", "d", "2", "e", "3",
"g", "4", "h", "5", ), tibble::tribble(~colA, ~colB, "b",
"1", "d", "2", "e", "3"))
#> [[1]]
#> # A tibble: 5 x 2
#> colA colB
#> <chr> <chr>
#> 1 b 1
#> 2 d 2
#> 3 e 3
#> 4 g 4
#> 5 h 5
#>
#> [[2]]
#> # A tibble: 3 x 2
#> colA colB
#> <chr> <chr>
#> 1 b 1
#> 2 d 2
#> 3 e 3
Created on 2021-03-03 by the reprex package (v0.3.0)
Alguém tem uma sugestão de como fazer? A ideia é que não dependa das colunas, pois pode ser que tenham mais colunas com valores iguais. Por exemplo, uma colC
. Desde já, obrigado!