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?

  • 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 May 25 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 May 26 at 23:02
  • @gregoryg remote and local are both Linux boxes, albeit different distributions. – cfgauss May 26 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 May 28 at 14:31
  • 1
    @gregoryg Please upgrade the comment to a solution and I'll accept it. – cfgauss May 31 at 21:32
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.

| improve this answer | |
1

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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