For my work, I am frequently logged in via ssh to a high performance computing cluster and frequently edit files (including .R and .Rmd) there. I have grown used to editing the files with the TextMate editor using the rmate utility (http://github.com/textmate/rmate). So my recurrent use case is:
- open terminal
- ssh cluster
- rmate file.R
- edit file with my fav text editor
- save the file (automatically it’s saved in the cluster).
I tested that this same workflow can be done using Cyberduck in a Mac and WinSCP in a Windows machine using the “edit with” functionality and choosing RStudio. But I haven’t found a way to do this with a command utility, which would make the process more robust. Right now if I close Cyberduck or it crashes, then I’m in trouble.
Is there such a command that I can type in the terminal to open a file with RStudio in my laptop? Looks like it should be doable given that WinSCP and Cyberduck work.
I asked in an internal Slack and via https://twitter.com/fellgernon/status/964542934950531072 but didn’t get an answer. Also, I looked through github. com/rstudio/rstudio/issues and the community website and didn’t find information about this. But if it’s there, please let me know!
With the introduction of the RStudio terminal (support.rstudio .com/hc/en-us/articles/115010737148-Using-the-RStudio-Terminal) it makes sense to me to switch from TextMate to RStudio, mainly because now it’s possible to “send to terminal” for evaluating code in the text file (.R, .Rmd, etc). Plus RStudio has many R related features that TextMate doesn’t have.
- When you configure rmate you have to choose a port and enable some port forwarding in your ~/.ssh/config file. Maybe the equivalent command for RStudio will need to do something similar.
- rmate can be used with Sublime Text as well github .com/henrikpersson/rsub. Several colleagues use this.
- Why not run RStudio in the cluster itself? Because it’s super slow via X11 forwarding. Plus it’s not as easy to keep it updated.
- Why don’t edit files in the cluster with vi/emacs? Because I like TextMate (or Sublime) more than those for long R-centric files. And the whole point is that I’m considering switching to RStudio.