I have just started to use Sublime Text 2 to edit/write R codes and have installed the SublimeREPL package to execute R code within the editor. When I write a new R script it fails to read files in the SAME directory with the error:
Error in file(file, “rt”) : cannot open the connection
I checked getwd()
and it shows C:/windows/system32
which is probably the directory where sublime text is installed.
Is there a way to set the current working directory to the location of the current file. This can be easily done in RStudio with Session > setwd > source file location
.
I can use the full path of the data file as a workaround, but I think that is not a convenient solution.
Any help would be greatly appreciated.