1 Goal


The goal of this tutorial is to set the working directory in the folder where the script is saved.


2 Setting the working directory


# We canuse the following line to set the working directory
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))

3 Conclusion


In this tutorial we have learnt how to set the working directory in the actual folder of the script.