Created
August 3, 2023 08:17
-
-
Save opplatek/54a3388eee22b858635e97050ca646f2 to your computer and use it in GitHub Desktop.
Read a list of files (TSV) and merge them to one data.frame
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Read a list of files (TSV) and merge them to one data.frame | |
# | |
read_tsv <- function(x){ | |
df.file <- read.table(file = x, header = T, stringsAsFactors = F, sep = "\t") | |
return(df.file) | |
} | |
files <- c("a.tsv", "b.tsv", "c.tsv") | |
df_list <- lapply(files, read_tsv) | |
df <- do.call(rbind, df_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment