Last active
September 25, 2019 02:24
-
-
Save timedreamer/272c5f62900b1c19ed625f173067ab88 to your computer and use it in GitHub Desktop.
Read all files in a folder(sub-folder) into a dataframe in R.
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
# Date: 2019-09-24 | |
list_of_files <- list.files(path = here("data", "dap_download_may2016_genes"), | |
recursive = TRUE, pattern = "\\.txt$", full.names = TRUE) | |
# I discard the amp-DAP data. | |
list_of_files <- list_of_files[!str_detect(list_of_files, "amp")] | |
dap <- list_of_files %>% | |
set_names(.) %>% | |
map_df(read_tsv) %>% | |
rename(regulator = "tf.at_id", target = "target.at_id") | |
write_tsv(dap, here("data", "arabidopsis_dapseq_all_noamp.tsv.gz")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment