Without a reprex, I am not sure I understand what you want to do.
Here is a solution based on what I understood (but that may not be what you are trying to do).
Let's create some data:
library(tidyverse)
a <- tibble(
x = 1:5,
y = letters[1:5]
)
b <- tibble(
var1 = sample(1:10, 10, replace = T),
var2 = sample(1:10, 10, replace = T)
)
I understood that you want to see if each value of a$x (for instance) matches the entire values of b$var1 (for instance). And you want the results in a new column. I understood this as "a new column in b" and, unless a$x only contains one value, there will be as many new columns in b as there are values in a$x.
Here is the solution for this:
bind_cols(b, map_dfc(a$x, ~ transmute(b, new_col = a$x[.] == b$var1)))
It gives:
# A tibble: 10 x 7
var1 var2 names names1 names2 names3 names4
<int> <int> <lgl> <lgl> <lgl> <lgl> <lgl>
1 1 9 TRUE FALSE FALSE FALSE FALSE
2 8 9 FALSE FALSE FALSE FALSE FALSE
3 6 4 FALSE FALSE FALSE FALSE FALSE
4 5 4 FALSE FALSE FALSE FALSE TRUE
5 7 4 FALSE FALSE FALSE FALSE FALSE
6 1 9 TRUE FALSE FALSE FALSE FALSE
7 2 7 FALSE TRUE FALSE FALSE FALSE
8 10 4 FALSE FALSE FALSE FALSE FALSE
9 2 5 FALSE TRUE FALSE FALSE FALSE
10 7 9 FALSE FALSE FALSE FALSE FALSE