esqLABS / esqlabsR.reports

Other
0 stars 0 forks source link

Set working directory globally #5

Open PavelBal opened 1 year ago

PavelBal commented 1 year ago

Currently, each R code chunk that relies on esqlabsR framework requires a

wd <- file.path(getwd(), "..")
setwd(wd)

section. Would be good if the working directory could be set only once for all r chunks.

Felixmil commented 1 year ago

For quarto and Rmarkdown, working directory is always where the notebook is stored. Even for other scripts that are sourced from the notebook.

The problem in the current folder setup is that the notebooks are in a different directory than the .Rproj file.

In order to make things more stable and less confusing for the user, we need to have the notebooks at the same level as the .Rproj file. This can be achieved in two ways:

  1. Notebook files are stored in /Code directory, not in a subfolder
  2. Each report has its own .Rproj file and is stored in a directory together with all the files specific to this report.

I would go for the second solution because each report would be isolated, and thus we can implement versioning, sync on github and make things way easier to collaborate and reproduce a report.