1 R, RStudio, and Quarto
1.1 What is R?
R is a “programming language” that once we can speak (write) it, we can use it to tell our computer to do things with our data. Just like learning a real language, learning a programming language involves learning an entirely new vocabulary along with the grammar rules that glues it all together. .
Many of you may be familiar with other software programs, like Excel, SAS, SPSS, STATA, or MATLAB. The main issues with these software programs, is that they are proprietary and they cost money.
R, however, is what is called an “open source” programming language. This means that it is completely free, and also that anyone can be an R developer. The result is that there are massive diverse communities of people who have come together to contribute to the R programming language, helping turn it into the powerful programming tool that it is today.
1.2 What is RStudio?
The RStudio “IDE”, which is the computer application that most people use to write their R code (RStudio is to R code what a Word Doc is to text).
I should probably note here that Posit, the company behind RStudio, has recently developed a new application or “IDE” called Positron that will likely eventually supersede RStudio, but Positron still in “Beta” mode and, for now, my recommendation is to stick with RStudio. Rest assured, I’ll update this page once I feel like Positron is ready for general use.
1.3 Downloading R and RStudio
If you will be using R “locally” (i.e., on your own computer, rather than in the cloud), then you will need to download R from the CRAN website (https://cran.rstudio.com/). While this will download an “R” application in which you can technically write R code, I recommend that you instead write your R code inside a separate desktop application called RStudio. You can download RStudio from the Posit website https://posit.co/downloads/.
Even if you already have R and RStudio on your computer, I recommend that you re-download them to ensure that you have the latest versions.
It is good practice to keep up-to-date with the latest versions. In general, I recommend actively re-installing the latest new versions of R and RStudio at least every 6 months or so.
Alternatively, if you prefer not to (or cannot) download applications from the web onto your computer, you can use R and RStudio directly in your web browser with Posit cloud.
1.4 A tour of RStudio
Since we will be using R inside RStudio, let’s start with a quick tour of RStudio.
Whether you’re using RStudio “locally” on your own computer, or in the cloud, when you open RStudio, it should look something like this:
If you go ahead and select File > New File > Quarto Document, type “My first R” in the “Title” bar and your name in the “Author” bar, then your RStudio should look something like this: