Re: how to make an example, you can create 2 or 3 dummy files, just to read back in. We don't need to work with your actual files, we just need a realistic scenario.
You need to capture the list of files and apply names to it, based on its values.
Those names will propagate to downstream work in a nice way and that is a general fact.
Something along these lines will work:
library(tidyverse)
writeLines("x,y\n1,a", "a.csv")
writeLines("x,y\n2,b", "b.csv")
writeLines("x,y\n3,c", "c.csv")
(my_files <- list.files(pattern = "*.csv"))
#> [1] "a.csv" "b.csv" "c.csv"
my_files %>%
set_names() %>%
map_dfr(read_csv, .id = "source")
#> Parsed with column specification:
#> cols(
#> x = col_double(),
#> y = col_character()
#> )
#> Parsed with column specification:
#> cols(
#> x = col_double(),
#> y = col_character()
#> )
#> Parsed with column specification:
#> cols(
#> x = col_double(),
#> y = col_character()
#> )
#> # A tibble: 3 x 3
#> source x y
#> <chr> <dbl> <chr>
#> 1 a.csv 1 a
#> 2 b.csv 2 b
#> 3 c.csv 3 c
Created on 2018-12-13 by the reprex package (v0.2.1.9000)