CHU0387 | National Taiwan Normal University
Get to know R:
The main program where all the mathematical magic and deep computations happen.
A user-friendly interface that makes it incredibly easy to interact with R.
🧠 Think about it
With a computer, you can create folders, open Word or Excel documents, write in them, and save them in the folders you created.
You used your mouse or your touchpad and clicking on icons (or figures) on your screen to do so.
It is your computer that ran your behavior in programs able to perform computations. Your role: Trigger these programs by using the user-friendly interface installed in your computer.
R = perform the computations that you ask for.
RStudio = The user-friendly interface for R.
Go to the RStudio website by clicking here. You will see something like this:

Next, choose your CRAN (The Comprehensive R Archive Network). Let’s choose the one in Taiwan. You will need to scroll down the page to find the link.

Choose the files to download according to your computer’s operating system. The most common are macOS (for Apple computers) or Windows.

On the next page, choose the subdirectory. For our purposes, we only need the “base” subdirectory.

We finally got to the last page! Click on the first link to download the files, as shown below. Wait until the file is downloaded, open it, and follow the standard instructions to install R on your computer.

Now that R is installed, it is time to do the same with RStudio. Go to the RStudio website by clicking here. You will see something like this:

Scroll down to look for the download links. Again, choose the right file for your operating system. Just click the link, let it download, open the file, and follow the instructions!

Look for the program called “RStudio” on your computer. Once you find it, just open it up, and you can move on to the next section!
💡 Wait, why didn’t we open R?
Recall that R is the program where computations are done, and RStudio is the user-friendly interface. Even though we needed to download both, you actually only ever need to open RStudio when you want to use R! RStudio will talk to R in the background for you.
Why?
We want to be organized and not messy!
Documents (or 文件) folder.CHU0358_DocumentsScriptsSlides: Presentation files.PreprocessingAnalysesR: Datasets & R code.Pay attention to the names
Generally, it is better not to use any space when naming folders and files!
1. Launch New Project Wizard
Click the blue cube icon in the top-left corner of RStudio.
2. Select project type
Choose “Existing Directory” to link R to your folder structure.
3. Finalize Connection
Browse to PreprocessingAnalysesR, check “Open in a new session”, and click Create Project.



Benefit: An .Rproj file sets your “Working Directory” automatically!

Task list: