I have used
dirname(sys.frame(1)$ofile)
to get the directory of the script I am currently running
It worked perfectly until recently where it returns an error message
Error in sys.frame(1) : not that many frames on the stack
I have my code and data in Dropbox, and since I run it on various computers where dropbox is located differently, I want to be able to know where the script running is located.
Any idea why dirname(sys.frame(1)$ofile) does not work anymore, and how to get a solution.
There is a lot having the same problem as I, but the solutions either dont work or suggest another way which does not fit.