Installing R and RStudio on a Pixel Slate

Instructions how to install R and R Studio on a Pixel Slate (or a Chromebook)

The Google Pixel Slate allow users to run Linux applications. Getting R and R studio up and running is (relatively) straightforward (after a little bit of trial and error). First, enable Linux by going to the settings of Chrome and then turning on the Linux virtual machine (see below):

Click install.

After, the Linux terminal should appear. Type:

sudo apt-get update

sudo apt-get install r-base r-base-dev

(sudo is short for superuse do). You will get a warning that it will take up 367 Mb of space and if you want to continue (press Y):

R

R is now installed (I do not know why 3.3.3 is the version installed [even though the latest version is 3.5], I was just happy to get it installed):

However, you probably will also want to install R Studio. Using Chrome, go to the R Studio website and download the appropriate Linux version. In this case, download the one that indicates Debian 9+ (I tried the other version and did not seem to work).

The install file is now downloaded and you will want to transfer it to the Linux partition. Go to the downloads section. It will indicate Downloads, Play files, and Linux files. You will have to drag the rstudio file (with the .deb extension) to the Linux files to copy it over.

Go back to the terminal window and type ls to see if the file was copied over. (the first ls was before copying it over)

The file should appear in red.

To install the file, type (using whatever version of R studio is now available):

sudo apt-get install gdebi-core

This installs gdebi-core which is used to install .deb files. Press Y when it asks to continue and hit enter.

Afterwards, type:

sudo gdebi rstudio-xenial-1.1.463-amd64.deb

Press y and enter to proceed with the installation.

You are almost ready: if you just type rstudio and Enter, a warning will appear that shared libraries: libxslt.so.1 failed to load. Install it first by running:

sudo apt-get install libxslt1-dev

Press Y and Enter to install. After it is installed, you can just type:

rstudio

to launch Rstudio: you will get a tiny screen with tiny fonts. You can maximize the screen and hit Ctrl + Shift + + to repeatedly until the font size maxes out and you can read the screen without squinting.

Congratulations! You can now install your usual packages (for some reason, this takes a while). In the app section, you will also now have an RStudio icon that you can use to directly run RStudio.

Shown below is a basic plot drawn using ggplot2.

You can problably also follow the install directions here for a Chromebook but I haven’t tried that out. I tried also installing the tidyverse package but got a nonzero exit status (I do not know which package is causing that since so many packages are installed in the process and haven’t tracked down which one it is).

Update: (2018.12.20) NOTE: when you are installing packages and there is a nonzero exit status, check the error messages. If for example, you are missing curl, you will have to install it. It may tell you what to install.

sudo apt-get install libcurl4-openssl-dev

— END

Related

Next
Previous
comments powered by Disqus