We will experience brief service disruptions (see "Updates")
(the number of current visitors is automatically updated every 4 minutes)
If you want to share information about this web page...
R is arguably the most powerful statistical software available, and it is completely free. This webpage provides you with an introduction to what R is and how you can start using it.
R is a programming language. It can be used as a general-purpose programming language to build web apps, automate your computer, create art, and retrieve information. However, if the application you are building in R does not handle data or logic in some form, there are often other languages (like Python or JavaScript) that do the job more efficiently. The primary use case for R is to manage and analyze collected data. In research contexts, R is frequently used as an advanced data processing and statistical tool, offering features such as:
- Advanced data handling: With packages like
tidyverse(especiallydplyrandtidyr), you can program complex rules to clean data, merge dozens of files, change formats from “wide” to “long,” and handle text strings in ways that are nearly impossible in a traditional click-based interface. - Total control over graphics: You have pixel-perfect control. You can tweak every single detail in a graph—colors, fonts, scales, annotations—and create completely unique visualizations that do not exist as standard default options.
- Automation and loops: You can write a script (using a loop or a function) that automatically goes through 100 files, runs the analysis, saves the results, and generates graphs in a matter of seconds.
- Access to almost infinite statistical methods: You have direct access to CRAN (The Comprehensive R Archive Network), which contains over 20,000 packages. If a new statistical method was invented yesterday, there is probably already an R package for it today.
R is optimized for flexibility and control. This is necessary when you have very complex data, need to tailor unique analyses, or want to automate your work. You can compare R to the engine of a car. The engine makes things happen but can be a bit tricky to tame. It is what does the heavy lifting, performs the calculations, and drives everything forward. Without the engine, nothing happens.
If you open just R, you are met with a single large text box (the console) where you write code and get answers. You must type everything exactly right, otherwise it will not work. You can install a program called RStudio that simplifies things a bit. If R is the engine, then RStudio is the dashboard, the steering wheel, and the comfortable seats. It makes it possible for you to control the engine (R) in an easier and more comfortable way. If you want to simplify things even further, you can install the free software Jamovi. Jamovi is a separate statistical program that runs R code in the background via drop-down menus (similar to SPSS). You can read more about Jamovi on a separate webpage. Therefore, you can run R code at different levels of difficulty:
- The easiest place to start is the program Jamovi, which is built on R. Jamovi is optimized for most common statistical analyses with a focus on user-friendliness. It is perfect for standard statistics and when you want to avoid coding.
- RStudio can be installed and sits as a layer on top of the bare R program. Technically, R is a programming language, while RStudio is an IDE (Integrated Development Environment). RStudio adds several features related to user-friendliness (see below).
- The most difficult option is using bare R without RStudio.
RStudio
Here is what RStudio adds that “bare” R lacks:
1. An overview of everything at once (the 4-window layout)
If you just open R, you are met with a single large text box (the console) where you write code and get answers. RStudio divides the screen into four parts that give you total control:
- Code editor: Where you write and save your scripts.
- Console: Where the code runs (the R engine).
- Environment: A list of all your variables and datasets.
- Files/Plots/Help: A place to see your files, view graphs, and read help files.
2. “IntelliSense” (Autocomplete)
This is a huge time-saver.
- R: You have to remember exactly what every command is called and how it is spelled.
- RStudio: When you start typing (e.g.,
rea...), RStudio automatically suggests commands (likeread.csv), shows what arguments the function needs, and helps you close parentheses automatically.
3. Visual inspection of data
- R: To see your dataset, you have to write commands like
head(data)orprint(data), which just spits out text in the console. - RStudio: You can click on your dataset in the “Environment” window, and it opens in a tab that looks exactly like Excel. You can scroll, sort, and filter to quickly check that the data looks right (even though you cannot edit the cells there).
4. Project management
- R: You often have to struggle with file paths (
C:/Users/Name/Documents/...) and keep track of where R is “looking” right now (working directory). - RStudio: Has a system with “Projects” (
.Rproj). When you open a project, RStudio automatically knows that all files are located in that folder. This makes it much easier to move code between computers or share it with colleagues.
5. Handling of plots (graphs)
- R: Every time you create a new graph, the old one is deleted (or a new window opens that floats around).
- RStudio: Has a dedicated “Plots” tab. You can browse back and forth between your graphs like in an image gallery and easily export them as image files or PDFs with the correct size.
6. Integrated tools for publishing (R Markdown / Quarto)
RStudio is built for creating reports. With the click of a button (“Knit”), you can turn your code and your analyses into finished PDF reports, Word documents, or HTML pages. This is built into RStudio in a way that makes it seamless to mix text and code.
Summary of what RStudio adds
You can drive a car by sitting on a box and pulling wires directly connected to the engine (R), but it is much more comfortable and efficient to sit in the driver’s seat with a proper dashboard (RStudio).