Answers for "how to source all fies from a directory in r"

R
0

how to source all fies from a directory in r

setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) # set the work directory
# to the same file location that the r script is in.
WD <- getwd() # get the current working directory

# Load the supporting scripts from the folder supporting scripts
files.sources = list.files(paste0(WD,'/supporting scripts/'))
files.sources = paste0(WD, '/supporting scripts/', files.sources)
sapply(files.sources, source)
Posted by: Guest on January-26-2021

Code answers related to "how to source all fies from a directory in r"

Browse Popular Code Answers by Language