Section 1.1

Installation of R/RStudio

Aymeric Collart

Institute of Linguistics, Academia Sinica

2024-11-26

Introduction to R and RStudio

What is R? What is RStudio?

We are actually referring to two programs:

Main program: R

This is where all the magic happens.

Interface: RStudio

User-friendly interface such that it is easier to work with.

What is the difference between the two? A comparison

Computer Circle Right Folder Open Circle Right File Word File Excel File Powerpoint Circle Right Floppy Disk

And now, think about it

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. Your computer 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!

Download and install R

Download and install R (1/5)

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.

Download and install R (2/5)

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.

Download and install R (3/5)

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).

Download and install R (4/5)

On the next page, you will need to choose the subdirectory that you need. For our purposes, we’ll only need the “base” subdirectory.

Download and install R (5/5)

We finally got to the last page!

Just click on the first link to download the files, as in the image. Wait until the file is downloaded, open it and follow the instructions to install R on your computer.

Download and install RStudio

Download and install RStudio (1/3)

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):

Download and install RStudio (2/3)

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.

Download and install RStudio (3/3)

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.

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!