Last active
December 2, 2019 21:30
-
-
Save jananiravi/21e284deb6f5602136ac12c29fb1b5c0 to your computer and use it in GitHub Desktop.
To source all R scripts within a single folder with tidyverse>purrr>map!
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
# If you want to use `tidyverse` to do this, you could use the `map` function to simplify! | |
my_path <- c("/path/to/files/") # set your path | |
source_files <- list.files(my_path, "*.R") # locate all .R files | |
map(paste0(my_path, source_files), source) # source all your R scripts! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment