I love my iPad. It’s not exactly new: it’s a 12.9 inch model from three years ago. But even so, it’s light and convenient and fast enough not to be painful.
What I like about it:
- easy to write with (I have this keyboard)
- drawing with a pencil is almost as immediate, with almost the same control, as pen and paper
- it’s easy on the eyes when it comes to reading
- the split-screen mode is great for taking notes while reading
- the games are great – I’m fond of iPad re-imaginings of things like Baldur’s Gate
- when I’m traveling, I can buy mobile data and it mostly just works
I can perform plenty of my engineering and scrum masterly duties with it:
- I can manage and interrogate the AWS and Google Cloud web consoles
- I can use Google Drive, Docs, Sheets etc.
- I have access to my iCloud file storage as well
I do have trouble with some things though:
- Although I can ssh into things and do some scripting full-on development is rather tricky
- I like to dabble with data science ideas from time to time, for which I usually use RStudio
I realise there are several web-based data science platforms, Jupyter notebook services of various types, but I still prefer RStudio. Besides which, my other blog is managed via blogdown, which is easy to deal with RStudio. How can I work with this tool on the iPad?
RStudio Cloud 🔗
The obvious thing to try, once you’ve discovered that it is a thing, is RStudio Cloud.
This presents pretty much the full RStudio experience in browser-based format, complete with console, graph viewer etc. At the time of writing, it’s free, although a paid plan is in the works.
I tried this for a while and it worked well – most of the time. I’d run into odd problems, times when the whole thing would stop, or crash. I had little success in trying to work out the cause. The free version has an options section that shows CPU limits. I suspect I was hitting these limits, but at the moment there’s no way to dig further, or increase those limits.
Your Own RStudio Cloud 🔗
So, I decided to build my own. It turned out quite straightforward in the end:
- setup an internet-accessible machine with a suitable OS for RStudio Server
- Install RStudio Server on it
- Configure RStudio Server for my needs
Setting Up A VM On Google Cloud 🔗
You can use any standard Linux box for this but for the first step, I chose a Google Cloud VM with Debian 10. If you wish to use this you will need Google Cloud Console access with billing enabled.
I chose the default options here, 1 CPU with 3.75GB memory, and Debian 10. I also enabled the firewall options for HTTP and HTTPS.
Once this has been created you can find it in your list of VMs and get shell access via SSH in the browser:
Installing RStudio Server 🔗
I followed the instructions here, with a few minor tweaks:
sudo apt-get install r-base
sudo apt-get install gdebi-core
sudo apt-get install wget
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.3.959-amd64.deb
sudo gdebi rstudio-server-1.3.959-amd64.deb
In order to get some graphical R libraries to work I also installed the following:
sudo apt-get install libglu1-mesa-dev
My VM did not come with git so I installed that too:
sudo apt-get install git
Configuring The Server 🔗
Once RStudio was installed and running I followed these instructions to tweak it to my needs.
The main thing I wanted to change was the port. I set up the VM in Google Cloud to expose HTTP, port 80, so I changed the default port by adding the line
www-port=80
to /etc/rstudio/rserver.conf and restarting the service. You can then connect to the IP address of your server in a browser. Note that this is HTTP, not HTTPS!
Before trying to login though I added a user. RStudio Server by default will use the UNIX accounts on the box, so I created a new user just for this purpose:
user add -m your-username
passwd your-username
You can then log in via the browser by just visiting the public IP address of your instance:
You should then be logged into your very own RStudio Server instance and can install packages, checkout git repositories etc.
Limitations 🔗
There are still some problems access RStudio Server on an iPad. The window is small and there’s a bit more scrolling involved.
Cutting and pasting is…problematic. It works reasonably well most of the time, but the real trouble starts when you try to select a range of text. I can’t seem to get this to work in the browser. What I can do though is select all, and then whittle it down to what I want.
Specific issues with my home-grown version, as opposed to RStudio Cloud:
- it’s HTTP, not HTTPS – I still need to sort out more secure access somehow
- it’s not free – how much it will cost depends on how long you run it for and how much CPU time – make sure you turn it off when not in use Of course, if you have some heavy use planned then you can build a much more powerful VM, something you can’t yet do with RStudio Cloud.
So far I’ve used this system to check on various reports while sitting in the sunshine away from my normal computer, but I will see how well it works when I’m out and about again.