d = '~/R Code/Library/'
files = list.files(d,'.r$')
for (f in files) {
if (!(f == 'mysource.r' )) {
print(paste('Sourcing',f))
source(paste(d,f,sep=''))
}
}
I use the above code to source all the files in a directory at start up with various utility programs I use in my interactive session with R. I am sure there are better ways but I find it useful for my work. The line that does this is as follows.
source("~/R Code/Library/mysource.r")