Getting started with RStudio IDE.
In this video, we'll be reviewing how to use RStudio IDE.
You'll also see how you can use Spark.
From the Data Scientist Workbench home page click RStudio IDE to open the tool.
First, let us talk about the interface.
On the left-hand side there is the console where you
can run commands and see your output.
For example, let's assign the value one to x,
as you can see here on the bottom left.
Then, after pressing enter,
we can see what x is,
under the Environment tab on the right side.
Or I can type one plus one and press enter to get the sum directly on the line below.
It's probably better to write code in a text or R Script editor,
which recognizes and corrects our syntax.
Then, just run the R code commands from the script editor instead.
So let us create the editor.
Select file, new file, R Script.
This shifts the console to the bottom left quadrant
and opens the R editor in the top left quadrant,
where you can enter your R code.
Let's type one plus two from the R editor.
As you can see, both the commands and the corresponding output are
displayed in the console when you press enter or run the code.
It's important to note that in the R editor
toolbar you have icons that will allow you to work faster.
Of the icons shown here,
the most important one you'll want to know is the save button,
which allows you to save your R Script to your Workbench account.
Please note that the R editor toolbar is not available in the console.
On the right side of the R editor you'll see two important buttons,
they are the run and rerun buttons.
As the name suggests,
the run button allows you to run the current line or selection.
To do so, simply press control enter if you are using a PC,
or command enter if you are using a Mac.
To rerun the previous code region press control shift P on a PC,
or command shift P on a Mac.
In the lab you'll get to familiarize yourself with these icons,
including learning more about and practicing with the powerful code tools dropdown menu.
Coding in R has never been easier.
So, to run your code,
selected lines or the current line,
and have the results display in the console,
you simply click the run icon on the toolbar or press control enter on a PC,
or command enter on a Mac.
You can run the same R code as many times as you like.
So, if you add another line in the editor,
for instance one plus 1000,
you can highlight both lines and run them.
By default, the editor runs only the current line.
However, if you highlight multiple lines it will run
all the code that is highlighted and the console displays this.
Note that the current directory path displays next to the console window title.
When you click the arrow beside
the directory the files tab is refreshed on the bottom right.
After saving the current code,
the file name displays in that directory,
in the files tab,
located in the bottom right quadrant.
To save the current code,
click file save, which opens up the save file window.
Or you can click on the save button at the top of the script.
Now, simply enter the file name and click save.
Click the different tabs in this quadrant to see plots of your data,
to see your packages,
to get help, and to view your data.
We encourage you to play with RStudio IDE to learn about and leverage its full potential.
This is the end of this getting started video. Thanks for watching.