On 2025-01-14 05:29, stardiviner wrote:

I tested using org-mode's `make repro` clean Emacs & org-mode environment instance. It works fine. I double checked my Emacs init file about R settings. Have not found suspicious config.

So to confirm, you *cannot* reproduce the error with a clean config?

Here is my reproduce test.

I tried running this, and it seems to work as expected.

The generated plot image "images/hist_rnorm.png" is NOT in
"~/Org/Programming/R/images/hist_rnorm.png". It's in "~/Org/hist_rnorm.png".

Some relevant settings that may be altered by your config are `ess-startup-directory` and `ess-startup-directory-function`. It might be, for example, that one of these is forcibly changing the R process' working directory to a project root ("~/Org", in this instance)

By the way, setting `:dir` changes the *working* directory, which you might not want to be "images". There is a separate header argument, `:output-dir` that can be used for this purpose.

Sam