Remotely Running RStudio

Why running on RStudio in the cloud/remotely…

  • To isolate environments/package dependencies
  • To share environments
  • To be able to run from any machine
  • To get better performance than your local machine can provide

Minimal Resource Options

There are free options available that can be used to share working environments or to avoid having to install RStudio and libraries on your own local machine. There can be issues with different versions of R and package versions, so using a cloud based solution allows you to keep an independent environment. These options are free but have limited space and memory.

Microsoft Azure Notebooks (Free)

Microsoft provides notebooks.azure.com which provides free, interactive coding in your browser. Multiple languages are supported (R, Python 2, Python 3, F#). There are interactive courses based on Jupyter notebooks.

  • create a notebook, start it up, can share it, etc.
  • not designed as a rich development environment, they recommend visual studio with r plugin for that. In my experience, this was quite slow.
  • Everything is a Jupyter notebook - all files are .ipynb
  • integrated with git
  • Memory is limited to 4Gb
  • Storage: We reserve the right to remove your data from our storage after 60 days of inactivity to avoid storing unused/abandoned user data. Usage should be limited to learning, research, general computing, etc. and must abide by the Microsoft Azure Terms of Use

rstudio.cloud (Free)

RStudio provides rstudio.cloud which is arstudio like environment, allows 1 private shared workspace, otherwise public workspaces with projects. Eventually there will be free and paid plans, similar to shinyapps.io with a free and paid tiers.

  • integrated with git
  • learning R with rstudio.cloud webinar
  • Each project is allocated 1GB of RAM.
  • Each account is allocated one private space, with up to 3 members and 5 projects. You can submit a request to the RStudio Cloud team for more capacity if you hit one of these space limits, and we will do our best accomodate you. If you are using a paid shinyapps.io account, you will not encounter these space limits.

Ability to Scale up - Increased Resources

If your primary reason for using a remote instance of R/RStudio is for additional performance (memory and/or computing resources), the following options are available.

These options require more initial setup but give you the ability to use substantial resources for relatively low cost. Pricing changes all the time. In some cases, the minimal resource options are free, but generally you should be prepared to pay.

As of 2018-05-30, on AWS, a t2.micro instance cost about 12 cents an hour, while a c4.2xlarge instance with 8 cpus and 32G RAM is about 40 cents an hour. It takes about 3-5 minutes to create a new instance from the images.

AWS

AWS - Initial Setup

The initial setup requires

  • an AWS account (with payment method)
  • install command line tools
  • setup a ssh key

Then each time you want to use the environment,

  • create an instance,
  • wait for it to start, and then
  • login via ssh and/or using your browser to use RStudio.

AWS Console

linux instructions

Pre-build RStudio Images

Here are two sources pre-built Linux images that provide RStudio in the browser that you can use.

Bioconductor packages can be tricky to install so if you’re using bioconductor, using the Bioconductor AWS images is a good way to go.

Using Bioconductor AWS Images

IP=IP_ADDR
ssh -vvv -i ~/.ssh/mykey.pem unbuntu@{IP}

If you don’t need bioconductor, then the RStudio images set up by Louis Aslet work well.

AWS - setup RStudio Louis Aslet - this has some setup to use GPUs, etc,

AWS - TensorFlow for R/RStudio

Google Compute Engine

Another option is Google Compute Engine

Digital Ocean

This is a more advanced option. Here you can programmatically create and destroy droplets (remote computers) via R.

https://github.com/sckott/analogsea

cloudyr

cloudyr - https://cloudyr.github.io/packages/index.html - tools etc for working with r in the cloud, umbrella project

Related