If the list of both key variables is identical, I want the row to be included in the final table, and if not then it should not be included. In the below example there are two key variables x and y. So the result should be only the first row since it's the only identical one in both key variables.

Refer to the code below:

```tib1 <- tibble(x = list(1, 2, 3), y = list(4, 5, 6))
tib1
# A tibble: 3 × 2
x         y
<list>    <list>
1 <dbl [1]> <dbl [1]>
2 <dbl [1]> <dbl [1]>
3 <dbl [1]> <dbl [1]>

tib2 <- tibble(x = list(1, 2, 4, 5), y = list(4, c(5, 10), 6, 7))
tib2
# A tibble: 4 × 2
x         y
<list>    <list>
1 <dbl [1]> <dbl [1]>
2 <dbl [1]> <dbl [2]>
3 <dbl [1]> <dbl [1]>
4 <dbl [1]> <dbl [1]>

dplyr::inner_join(tib1, tib2)```
Apr 6, 2018 1,457 views

## 1 answer to this question.

You can use the hash from digest as follows:

```tib1 <- tibble(x = list(1, 2, 3), y = list(4, 5, 6))
tib2 <- tibble(x = list(1, 2, 4, 5), y = list(4, c(5, 10), 6, 7))

tib1 <- mutate_all(tib1, funs(hash = map_chr(., digest::digest)))
tib2 <- mutate_all(tib2, funs(hash = map_chr(., digest::digest)))

dplyr::inner_join(tib1, tib2, c('x_hash', 'y_hash')) %>%
select(x.x, x.y)```

• 2,090 points

+1 vote

## How to sort a data frame by columns in R?

You can use dplyr function arrange() like ...READ MORE

## How to use group by for multiple columns in dplyr, using string vector input in R?

data = data.frame(   zzz11def = sample(LETTERS[1:3], 100, replace=TRUE),   zbc123qws1 ...READ MORE

## How to sum a variable by group in R?

You can also try this way, x_new = ...READ MORE

## How to remove NA values with dplyr::filter()

Try this: df %>% filter(!is.na(col1)) READ MORE

## How can I use parallel so that it preserves the list of data frames

You can use pmap as follows: nc <- ...READ MORE

## Join list of data.frames using map() call

You can use Reduce set.seed(24) r1 <- map(c(5, 10, 15), ...READ MORE

## How to use dplyr functions such as filter() inside nested data frames with map()

You can use map() call as follows:  map(full, ...READ MORE