I have about 30 functions for a research project and don't want to type
source(paste("C:/functions","/function1.txt",sep=""))
30 times where C:/functions is my directory of functions and /function1.txt is a particular function.
I've tried
files <- list.files("C:/functions")
sapply(1:length(files),source(paste("C:/functions/",files[i],sep="")))
And it doesn't work. Error message: Error in match.fun(FUN) :
c("'source(paste(\"C:/functions/\", ' is not a function, character or symbol", "' files[i], sep = \"\"), TRUE)' is not a function, character or symbol")
I've also tried it with a for loop and it doesn't work.