Section 1.1 Installation of R/RStudio
Slides of this section
1 What is R? What is RStudio?
So far, we have been talking about something called “R/RStudio”. People familiar with this program know what this is about. However, it can be quite confusing when we have never heard of it. We are actually referring to two programs:
R | RStudio |
---|---|
The main program is called R. This is where all the magic happens. RStudio is a user-friendly interface such that it is easier to work with.
Maybe a metaphor can help to understand the difference between R and RStudio. As you are engaging yourself in this tutorial, I assume that you have a computer (and that you are using one). You can create folders, open Word or Excel documents, write in it and save them in the folders you created.
This is the exact same thing with R and RStudio. R will perform the computations that you ask for. And you will ask R to do stuff by clicking on icons and writing commands using the user-friendly interface of RStudio. And this is why you need to download two programs!
2 Download and install R and RStudio
2.1 Download and install R
You can download R for free from the official website here.
You have to look for the link in the middle of the first paragraph on the front page.
Then, you need to choose your CRAN. Let’s choose the one in Taiwan. You will need to scroll down the page to find the link.
Now you need to choose the files to download according to the system of your computer. The likeliest to use are for MacOS (if you have a MacBook computer) or for Windows (if your system is Microsoft).
On the next page, you will need to choose the subdirectory that you need. For our purposes, we’ll only need the “base” subdirectory.
We finally got to the last page! Just click on the first link to download the files, as in the image below.
Just wait until the file is downloaded, open it and follow the instructions to install R on your computer.
2.2 Download and install RStudio
Now that R is installed on your computer, it is time to do the same with RStudio. First, let’s go to the RStudio website by clicking here , and you will see something like that (if not, it is just that the RStudio website has changed):
Once you are on the front page, just scroll down to look for the links to download the installing files. Again, you will need to choose the right file to download according to the system of your computer: Window, macOS (for the most common), or another one.
Just click on the link and the file will start to be downloaded! Again, give it some minutes, then open the file and follow the instructions to install RStudio on your computer.
3 Launch and try!
Look for the program called “RStudio” on your computer. Maybe you even have a shortcut on your desktop after installing it. Once you found it, just open RStudio, and you can go to the next section!