Hello Ihor,

On Sunday, 27 Nov 2022 at 11:52, Ihor Radchenko wrote:>

> So, if R has some way to override the working directory, we should
> enforce what we promise in the above section of our manual anyway.
>
> Otherwise, the will lose on Org document reproducibility.

This is a fair point, many thanks the insights.

ESS indeed overrides the working directory when ess-startup-directory is
set to nil. It only happens when :sessions are used though. Here I
created created a git repository in /tmp/test, and when a process is
initiated with session (the last code chunk) the process is started in
at the root of the git repository. 

#+BEGIN_SRC elisp
  (setq ess-startup-directory nil)
#+END_SRC

#+BEGIN_SRC elisp
  default-directory
#+END_SRC

#+RESULTS:
: /tmp/test/books/reading/


#+BEGIN_SRC R
    getwd()
#+END_SRC

#+RESULTS:
: /tmp/test/books/reading


#+begin_src R :session R:testing :results value
getwd()
#+end_src

#+RESULTS:
: /tmp/test

Thanks again, I'll improve this.

Best regards,
Jeremie

Reply via email to