Tutorial: Running R in Galileo

Written and developed by

Matthew Gasperetti
matthew@hypernetlabs.io
Alexander Berry
alexander@hypernetlabs.io

Tutorial: Running R in Galileo

Written and developed by

Matthew Gasperetti

matthew@hypernetlabs.io

Alexander Berry

alexander@hypernetlabs.io

Getting started with R in Galileo

(For a tutorial on running RStudio click here)

Getting started with R in Galileo

To get started with Galileo log into your account using Firefox or Chrome.

Understanding the user interface and cloning a Mission

When you log into Galileo, the first thing you’ll see is your Dashboard:

View of the Galileo Dashboard

To run the R example, start by navigating to the Missions tab using the side menu. Clone the R Batch example Mission from the Explore Missions tab. Use the filter to search for the mission by name and click “Apply”.

Find the public example mission by name

Once you have found the correct Mission, click “View Mission”.

Click View Mission

To clone the public Mission to your account, click the “Clone” button in the upper right corner of the interface. Choose between creating a public or private clone and also choose which Cargo Bay to use.

Clone the mission

You will now see a cloned copy of the Mission in your Missions.

The cloned copy

Let’s have a look at our files

The rMonteCarlo.R script conducts a linear regression, makes a simple plot, and then runs two Monte Carlo simulations.

The first Monte Carlo simulates tossing two dice and calculates the number of rolls that are 7 or less. The second Monte Carlo increases the number of iterations and runs the simulation in parallel.

Running a job and collecting results

Now we are ready to run a job using the Mission. Click the Run button in the upper right corner of the Mission tab. You will see a “Mission run successfully!” message. At the bottom of the Mission tab, you can track the progress of the job.

Track job progress

Once the computation is completed, the job will shut down and collect the results. Once the job progress reads “Completed”, you can download the results by opening the three-dot menu and clicking Download.

Download results

Let’s take a look at the the output.log file first, which returns the results of the regression and simulation:

Output.log results

Next, if we look in the results folder, we can see the plot we created for the regression:

Regression plot

We hope this tutorial was helpful. Please let us know if you have any questions or any problems using Galileo. Your feedback is extremely important to us. Contact us anytime at matthew@hypernetlabs.io or alexander@hypernetlabs.io.