I have an RScript file (let's call it main.r) which has a reference to another file, using the below code:
source("functions.R")
But, when I run the RScript file, it complains with the below error:
Error in file(filename, "r", encoding = encoding) :
cannot open the connection
In addition: Warning message:
In file(filename, "r", encoding = encoding) :
cannot open file 'functions.R': No such file or directory
I am sure, my main.R file is next to functions.R in the same directory.
I can call the functions.R in the Rmd (RMarkdown) file which exist in the same directory