What is R?

R is a computer language. In that way, it is similar to Python, C++, or French. All of these have meaningful words, syntax, and semantics. In R, the main parts of speech are equivalent to nouns and verbs; here those are called variables (or objects) and functions.

Today we will go through some of the basics of this language, but there is additional help in understanding “scripts”, which are essentially equivalent to essays, on the Understanding Code page of Data@Reed.

Why Use R?

R is widely used by people who analyze data. Common users are scientists, economists, marketers and many more. It is especially frequent in research in graduate school. The reason it is so widely used is because it is very “powerful” and is free. Powerful in this context refers to being able to handle large amounts of data, perform a vast array of statistical tests, and produce high quality data visualizations. It is also “open source” which means that all the code is available to everyone to use and modify how they see fit. Because of this there are thousands of custom packages that people have written to perform specialized statistical tasks. The community of people writing and creating in R is also very supportive, so it is easy to find help or tutorials for a task you want to do.

But speaking practically, why would one use R?

R makes your work go faster. Often times we are trying to repeat analyses and make the same graphs, and the code you write in R is reusable and will make this process go much faster. You only need to write out the instructions once, and then from there you can change a few variable names and run your entire analysis, start to finish, in mere seconds.

Also, because the community is large and supportive, you can often find premade scripts for what you want to do. You are encouraged to use these! There is no need to reinvent the wheel. Copy and paste is your friend when coding in R.

For more on why you should use R see here.

What is RStudio?

When you hear people talking about working in R, what they most likely mean is running the programming language of R inside a graphical interface called RStudio.

RStudio is software that makes it easier to use R because it helps you keep track of what code you’ve written, what variables you’ve created, and has built in help function. When you are working with R you are typically opening RStudio and coding within its framework.

Where to Find RStudio

To use RStudio at Reed you have two options: use the web-based version with your Reed login or download a copy of it to use on your personal computer. For more information on these see the R@Reed webpage.

Today it will probably be best to use Reed’s R server unless you have already downloaded your own copy of R and RStudio. You can also follow along solely in this document for this lesson, but you are encouraged to run things in the server or a downloaded version in the future.

The Reed Server

Reed hosts a web-based version of RStudio. You can find the Reed R server here at rstudio.reed.edu. You will be required to log in with your Reed Credentials (your username and password). If a sign in window that says “Sign in with SAML” appears, just click the button.

See this page for more details on the Reed RStudio server.