I want to make the current file location as the working directory.
Using Rstudio (Works!):
# Author : Bhishan Poudel # Program :
Simply, use rstudio API, extract its directory, and set it as a working directory as shown below:
setwd(dirname(rstudioapi::getSourceEditorContext()$path))
Verify if you set the directory correctly by the following command:
getwd()