A flexible way of doing this (no matter how many dataframes you are lookig at) can be reached using {purrr:reduce}. Just put your dataframes in a list and reduce them applying inner_join.
library(tibble)
library(dplyr)
library(purrr)
df1 <- tribble(
~V1, ~V2,
"a", "b",
"c", "d",
"a", "e"
)
df2 <- tribble(
~V1, ~V2,
"a", "b",
"c", "e",
"a", "f"
)
df3 <- tribble(
~V1, ~V2,
"a", "b",
"c", "f",
"a", "m"
)
# Put all data frames in a list
df_list <- list(df1, df2, df3)
reduce(df_list, inner_join)
#> Joining, by = c("V1", "V2")
#> Joining, by = c("V1", "V2")
#> # A tibble: 1 x 2
#> V1 V2
#> <chr> <chr>
#> 1 a b
Created on 2020-06-08 by the reprex package (v0.3.0)