Day 1 - Introduction to Data Analysis with R
Freie Universität Berlin - Theoretical Ecology
March 14, 2025
R is the programming language and the program that does the actual work
RStudio is the integrated development environment (IDE)
Summary
You can use R without RStudio but RStudio without R would be of little use
Execute R code
Output from R code in scripts is printed there
Type a command into the console and execute with Enter/Return
Tip
Use arrow keys to bring back last commands
Write scripts with R code
Scripts are text files with R commands (file ending .R
)
Use scripts to save commands for reuse
Summary
Use scripts for all your analysis and for commands that you want to save.
Use console for temporary commands, e.g. to test something.
Shows objects currently present in the R session
Is empty if you start R
Similar to Explorer/Finder
Browse project structure and files
Practical if you don’t want to switch between File Explorer and RStudio all the time
How to use RStudio to organize your projects
Advantages of using RStudio projects
Create a project from scratch:
RStudio will now create and open the project for you.
To open an RStudio project from your file explorer/finder, just double click on the .Rproj file
To open an RStudio project from RStudio, click on the project symbol on the top right of R Studio and select the project from the list.
Learn the most important keyboard shortcuts of R Studio.
Find all shortcuts under Tools -> Keyboard Shortcuts Help
Task 1 (20 min)
Set up your own RStudio project for this workshop
Find the task description here
Selina Baldauf // Introduction RStudio