I would like source()
to only find and load functions within a .R
file.
For example, in the file Analysis.R:
print.hw <- function() {
print("hello world")
}
x <- 1 + 2
...
When I source("Analysis.R")
, it will create the function print.hw
but also assign x
, which I do not want.
Anyone have any ideas? The best I could find was this question: