Modified from this link.
coverageFiles <- list.files(pattern = "*bedgraph") #Create a file list for all 10 files to import
list2env(lapply(setNames(coverageFiles,
make.names(gsub("s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_", "", coverageFiles))), read.table),
envir = .GlobalEnv) #Import files with list2env. Use lapply to setNames of the files by taking all the common parts of their names out. Files will be named zr2096_#_5x.bedgraph