Get all the files in your directory, in your case
d <- list.files("~/r_lib/")
then you can load them using the plyr package plyr
library(plyr) l_ply(d, function(x) source(paste("~/r_lib/", x, sep = "")))
If you like, you can do this in a loop or use another function instead of l_ply . Normal loop:
for (i in 1:length(d)) source(paste("~/r_lib/", d[[i]], sep = ""))
mropa
source share