3

I use tramp to edit R files on a remote server. When I evaluate R code within ESS-mode, it starts an R interpreter on the remote machine. However, at the moment ssh -X to the server does not work, so any R command that produces graphics does not connect to my local X11 server.

Is it possible to configure things so that ESS launches a local R interpreter and, hence, graphics would be displayed locally?

5
  • Just to clarify: you want to do this even though the remote and your local server may have different packages, different versions and different library paths installed? And saving the graphics as files rather than displaying them immediately is not the desired outcome?
    – gregoryg
    Commented May 25, 2020 at 20:45
  • @gregoryg I've had success using sshfs to do this since then the R interpreter executes locally and would like to know if tramp can also do this.
    – cfgauss
    Commented May 26, 2020 at 23:02
  • @gregoryg remote and local are both Linux boxes, albeit different distributions.
    – cfgauss
    Commented May 26, 2020 at 23:47
  • 1
    sshfs and TRAMP take opposite approaches. sshfs makes remote files appear local with a mount, allowing all processing to be local. TRAMP sends all processing to the remote machine, where files are dealt with as local only. So I don't think you can solve your use case with TRAMP. If you do want to save the remote graphics as files without invoking a viewer, you will be able to view those files in Emacs. But that's a different workflow.
    – gregoryg
    Commented May 28, 2020 at 14:31
  • 1
    @gregoryg Please upgrade the comment to a solution and I'll accept it.
    – cfgauss
    Commented May 31, 2020 at 21:32

2 Answers 2

1

I don't think that TRAMP can work well in this use case. You mention sshfs in a comment, but the two work differently.

sshfs and TRAMP take opposite approaches. sshfs makes remote files appear local with a mount, allowing all processing to be local. TRAMP sends all processing to the remote machine, where files are dealt with as local only.

So I don't think you can solve your use case with TRAMP. If you do want to save the remote graphics as files without invoking a viewer, you will be able to view those files in Emacs. But that's a different workflow.

2

I've fixed my ssh -X problem. Using tramp, in the remote R interpreter launched by ESS

> View(tibble)

with a 3,722-row tibble is not responsive with my 200 Mbps download speed. But using sshfs the same R interpreter is local and, hence, the View graphic is just as responsive as if I were sitting at the console of the remote machine. For me, this is the best workflow for creating R scripts at the remote machine. Thanks to gregoryg for comparing tramp/sshfs workflows and explaining that launching a local R process with tramp is not possible.

1
  • Can you please point to documentation on how to achieve this, or share your own?
    – lf_araujo
    Commented Feb 27 at 23:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.