This is the main course website for the tutorial "Introduction to R for scholars of humanities and social sciences" given at University of Bayreuth.
- 18. October 2023: The winter term 2023/24 starts. Welcome to a new iteration of the course!
Recordings of the lecture are available online. Please see the schedule for relevant videos and corresponding material. Make sure to enroll in the elearning-course to see assignments and get feedback on your solutions.
Syllabus¶
This course covers the basics of R: What are variables and how are they used? What data structures are there and what can we model with them? How do programming concepts like loops and functions work in R and what are they necessary for?
The course prepares students to be able to perform data analysis independently. Therefore, reading and writing external data files is an important topic as well as preparation of data for visualization and its actual visualization.
Special attention is paid to dealing with error messages. These contain important information about the parts of the program code that need to be revised. Therefore, we will provoke diverse error messages and learn to tackle the causes of them. In the course, students will learn how to independently search for help and apply it to their own problems.
Finally, the course includes some special tasks for humanities and social science students, such as social network analysis and text analysis.
Materials¶
In this section, you will find a list of tutorial videos helping you to get started with analyzing text data in R.
General Remarks¶
Title | Video | Material |
---|---|---|
Getting Help | ||
Find Help on the Internet | ||
Thinking in Scripts |
Hello World¶
Title | Video | Material |
---|---|---|
Getting Started in RStudio |
|
|
About Variables | ||
About Vectors |
Dataframes¶
Title | Video |
---|---|
About Dataframes | |
Modifying dataframes |
Working with external data¶
Title | Video |
---|---|
Read in data files | |
Obstacles with data files: Separators | |
Dealing with missing values |
Hello World pt. 2¶
Title | Video |
---|---|
Functions | |
Functions accepting parameters |
Assignments¶
Title | Video | Material |
---|---|---|
Submitting and Evaluating your Assignments |
Sort & Order¶
Title | Video |
---|---|
Sorting values and dataframes |
Visualization¶
Title | Video |
---|---|
Draw scatter plots and line plots | |
Draw pie charts | |
Draw bar charts | |
Draw histograms | |
Draw stacked and grouped bar charts | |
Customize your plots |
Conditions¶
Title | Video |
---|---|
Comparing Things | |
Conditional Selects | |
Combining multiple comparisons |
Aggregate¶
Title | Video |
---|---|
Aggregate data | |
Advanced use of aggregate function |
Merge¶
Title | Video |
---|---|
Merge tables | |
Advanced use of merge: specify columns | |
Advanced use of merge: missing data | |
Advanced use of merge: multiple columns | |
Advanced use of merge: continuous merge |
Advanced visualization¶
Title | Video |
---|---|
Add legends | |
Save your figures to files | |
Adjust the axes | |
Add more details to your plot | |
Combine multiple figures on one canvas |
Loops in R¶
Title | Video |
---|---|
for-loops | |
sapply-loops | |
When to use sapply vs. when to use for | |
Looping(s) through datasets |
Advanced Conditions¶
Title | Video |
---|---|
Execute Code Conditionally | |
Check vector elements | |
AND, OR, XOR | |
Conditions and vectors |
Legend¶
Find a video here | |
Find code material here | |
Find external material here |
References¶
- Alex Douglas, Deon Roos, Francesca Mancini, Ana Couto, and David Lusseau. An Introduction to R. online, https://intro2r.com/, 2022. https://intro2r.com/.