I tried to use rstudioapi::getSourceEditorContext()$path to get the current script path.
However, when I run rscript myscript.r in the dos command, it says, Error: RStudio not running Execution halted.
Any other methods?
Thanks
I tried to use rstudioapi::getSourceEditorContext()$path to get the current script path.
However, when I run rscript myscript.r in the dos command, it says, Error: RStudio not running Execution halted.
Any other methods?
Thanks
 
    
    Recently another package was developed called this.path to deal with this problem. I've tried it and it works very well.
