I'd like to find a way to evaluate my R code remotely, but insert images into my local org file.
I use R code blocks in my org files and insert images into the org file with something like this:
#+begin_src R :exports results :results graphics :file test.png plot(1) #+end_src
When ESS prompts me with:
ESS (*R*, R (default)) starting data directory?
I enter a remote location, e.g. /ssh:server:~/project/
The figure is then created in the remote directory and a link is inserted in the #+RESULTS, however this link "cannot determine image type". Basically the image isn't local and so isn't viewable. If I copy the image to the local directory, the link works and I see the image as if I had evaluated the code chunk locally.
I've also tried adding a :dir header argument and the full path to the image, like this:
#+begin_src R :exports results :results graphics :dir erker@krusty:~/ :file /tmp/test2.png
Can I specify somehow in the header arguments to write the file to a local directory so that it is inserted in the org file?