Search code examples
rserverrstudiorstudio-server

RStudio Server on Microsoft Azure instance


I am currently running R on a Microsoft Azure instance (Ubuntu virtual machine) using RStudio as my IDE, to which I connect simply through my browser. I am trying to run some commands that take quite some time to complete from within RStudio and figured that I could simply close my tab with RStudio open and the process would keep running. However, when I try to reconnect to see how the process is doing, the page keeps loading but I am unable to see RStudio.

I have a few questions regarding running RStudio on a server:

  1. First, am I correct in thinking that I can close my tab and keep the process running?
  2. Second, is it normal behaviour that I am unable to connect to the server while the process is running?
  3. Third, am I going about this the correct way or are there better ways?

Solution

    1. Yes, you can close your tab and keep it running.
    2. RStudio Server waits on updates from the R process to update the UI. This means that if you have a long-running computation, your tab may not fully reload until it's finished. You may also have seen this in the middle of a session: when R is busy, you can have problems saving scripts that are open in the editor pane.
    3. Logging out in the middle of a computation should be safe, but be aware that RStudio will save your workspace and shut R down after a period of inactivity. It then reloads everything when you log back in. But this only extends to objects in memory; if you have any files saved in your temp directory, they'll have disappeared when you come back. They're probably still on the disk, but since your new R session has a new temp directory, you'll have to do a manual search for them.