Section 1.1 Installation of R/RStudio

Slides of this section

The slides corresponding to this section can be found here: Chalkboard

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.

Think about it

Now it is time to reflect on what you are doing. You have done these tasks by using your mouse or your touchpad and clicking on icons (or figures) on your screen. What you may not know is that when doing so, you have run many lines of codes. Actually, it is your computer that ran them in programs able to perform computations. Your role has been to trigger these programs by using the user-friendly interface installed in your computer.

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!

Anecdote

Let me share a personal anecdote when I just entered graduate school and I had my very first class of language programming for linguistic research. Just before leaving, the instructor said very quickly that we had to, I quote, “download R for next time”. I had never heard of R, and to me, calling a program with only one letter seemed kind of awkward. Therefore, I assumed that I misheard the instructions, or that I missed some information. You can just imagine how surprised I was when I googled “R” and actually found that this existed!

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!

Think about it

Recall that R is the program where the computations are done, and RStudio the user-friendly interface. You may ask why I only said to open the RStudio program when it is only an interface. The good news is, even if we need to download both R and RStudio, you actually only need to open RStudio when you want to use R!