Getting started with R, 2 credits
R för nybörjare
Course information
Language of instruction: English
Course period: 14-16 January, 2026
Campus teaching or online teaching: In person
Recommended prerequisites
MSc in natural sciences or related field, experience/education in basic statistics.
Learning outcomes
After this course, students
- understand the basics of R as a programming language (objects, functions, data structures)
- are able to manipulate and clean datasets using base R and tidyverse tools
- know how to continue building programming and data skills beyond the course
- can visualise data with base graphics and ggplot2, and
- know how to continue building programming and data skills beyond the course.
This course provides a foundation for independent use of R in research projects and prepares students for Göran Arnqvist’s course Modern Statistics in Natural Sciences. Getting Started with R can be taken on its own, or directly before Modern Statistics begins (course times are coordinated).
Learning outcomes for doctoral degree
Teaching the use of R for independent statistical analyses as well as the selection and critical evaluation of statistical methods is associated with the following three PhD examination goals (According to Higher Education Ordinance, Appendix 2. (1993:100):
• "…demonstrate broad knowledge and systematic understanding of the research field as well as advanced and up-to-date specialised knowledge in a limited area of this field" (Knowledge and Understanding)
• "...demonstrate the capacity for scholarly analysis and synthesis as well as to review and assess new and complex phenomena, issues and situations autonomously and critically” (Skills and Abilities)
• "...demonstrate the ability to identify and formulate issues with scholarly precision critically, autonomously and creatively, and to plan and use appropriate methods to undertake research and other qualified tasks within predetermined time frames and to review and evaluate such work (Skills and Abilities)
Course contents
The course covers: data loading, writing, and manipulation; R command structure and data objects; good data practices and reproducibility with R projects; plotting with base graphics and ggplot2; and an introduction to programming structures (functions, conditionals, loops).
Instruction
In this course, students are first introduced to a topic and then spend most of the course time on independent solving of exercises. Exercises are designed to be challenging and ask students not only to write R code but also to make their own analysis decisions and to critically evaluate methods. Coding can be difficult but is best learnt by practice. We encourage learning and understanding by asking students to work at their own pace (continue earlier exercises later if needed) and by providing extensive individual help during the exercises with one assistant per 5-6 students. Once students are done with an exercise, we have full solutions available allowing students to self-correct their results and to get more coding input. These measures encourage students to work freely until they understand what they are doing as they do not have to worry that they would get completely stuck with coding or miss something if they need more time. The target teaching atmosphere in the exercises is one of high concentration among the students with some consulting with teachers in quiet voices (or digitally). During the sessions, students can sometimes be heard bursting out into "yes! now it works!".
Structure: The course consists of six half-day sessions, each composed of a lecture/live coding demonstration (1h) and associated exercises (2h). Exercises focus on realistic analysis steps and involve real datasets. Students are encouraged to work at their own pace throughout the sessions. During the practice time students have access to individual help from myself and 2-3 assistants, depending on student number. Exercises are designed to encourage independent thinking (rather than repetition).
Assessment
Attendance in 5 out of 6 sessions and submission of an exercise.
Course examiner
Gabriela Montejo-Kovacevich, gabriela.montejo-kovacevich@scilifelab.uu.se
Department with main responsibility
Department of Ecology and Genetics
Contact person
Gabriela Montejo-Kovacevich, gabriela.montejo-kovacevich@scilifelab.uu.se
Application
Submit the application for admission to: Application Getting started with R
Submit the application not later than: 2025-12-01