Getting Started with R

An Introduction to R and RStudio for beginners

Authors
Affiliations

Sufyan Suleman

Novo Nordisk Foundation Center for Basic Metabolic Research, University of Copenhagen Denmark

Asmat Ullah

Department of Biomedicine, Faculty of Health, Aarhus University Denmark

Course Overview

Welcome to a journey that will transform your data analysis skills and perspective. This course is a bridge from traditional platforms like STATA or Excel to the vibrant and dynamic world of R programming. Tailored for beginners, it offers a comprehensive introduction to R and RStudio, empowering you with essential skills and knowledge. We focus on building a strong foundation in R, enabling you to grasp its core concepts and functionalities. This course is your first step towards advanced programming and statistical analysis in R, setting you up for a world of opportunities and deeper exploration in this powerful programming language.

How to Use This Course

This is a self-paced course – there’s no instructor, no fixed schedule, and no deadline. You decide when to start, when to pause, and when to continue. Most learners complete the whole course in roughly 6-9 hours, but take whatever pace feels comfortable. Little and often (e.g. one session a day) tends to work better than cramming.

The course at a glance

The course is organised into 3 modules made up of 9 sessions. Head to the Course Roadmap for the full breakdown, time estimates, and a few suggested pacing plans.

  • Module 1 – Getting Started: install R and RStudio, learn the basic building blocks of the language, and start writing your work in R Markdown.
  • Module 2 – Working with Data: store and manipulate data using vectors, factors, data frames, and lists, and learn how to extend R with packages.
  • Module 3 – Data in Action: import real data, explore and clean it, visualise it, and learn how to find help when you get stuck.

What every session looks like

Every session follows the same pattern, so you always know what to expect:

  1. Session Overview – a box at the top telling you the estimated time, what you’ll be able to do by the end, and what you should already know before starting.
  2. Lesson content – explanations, analogies, and code examples you can follow along with in RStudio.
  3. “Try it yourself” prompts – small, ungraded tweaks to try immediately after an example, before moving on.
  4. Exercises – numbered practice tasks with a click-to-reveal solution, so you can attempt them yourself first.
  5. Summary & Self-Check – a recap of the key points plus a couple of short self-check questions to confirm the ideas have landed, finishing with a link to what’s next.

Tips for learning on your own

Tip
  • Type the code yourself rather than copy-pasting – it builds muscle memory and helps errors stick in your memory too.
  • Attempt exercises before checking the solution. Getting it “wrong” first is part of how you learn.
  • Use the self-check questions at the end of each session as a signal – if something doesn’t click, re-read that section before moving on.
  • Don’t panic about errors. They’re a normal part of coding. The Troubleshooting & FAQ appendix covers the errors beginners hit most often.
  • Look up unfamiliar terms in the Glossary at any time – you don’t need to memorise definitions before moving on.
  • Still stuck? The R community is large and friendly – see the Community and Support links in the first session.

What You Will Learn

  • Grasp the fundamentals of R and RStudio.
  • Learn to do effective data documentation in R.
  • Understand and manage data using R’s data structures.
  • Navigate through the installation and package management in R.
  • Import and visualize data.
  • How to get help.

What You Will Not Learn

  • Intermediate or Advanced R programming.
  • Complex data analysis.
  • Statistical analysis.
  • Machine learning.
  • For these topics please look at our other upcoming courses.

Why Choose R?

R is more than a programming language; it’s a gateway to advanced data analysis across various fields. Its superior statistical capabilities, flexibility in handling large data sets, and a vast package ecosystem make it an essential skill for researchers and professionals across all domains. Whether you’re in finance, healthcare, academia, or any field that relies on data, R equips you with the power to make informed decisions and uncover insights from data. By learning R, you’re not just gaining a skill, you’re opening doors to a multitude of opportunities in data-driven fields. If you are comfortable with Excel and STATA, you’ll find R to be a natural progression but with more power, flexibility and a larger community.

Aims

  1. Introduce R and RStudio to learners.
  2. Guide through R and RStudio installation, including package management.
  3. Teach essential R syntax, operations, and R Markdown usage.
  4. Equip learners to manage R data structures for analysis.
  5. Actively engage learners throughout the course.
  6. Support independent, self-paced learning with built-in checkpoints, self-check questions, and reference material (glossary, troubleshooting guide).

Learning Objectives

Upon completing this course, you’ll gain proficiency in:

  1. R fundamentals and the RStudio IDE.
  2. Effortless installation of R and RStudio.
  3. Mastery of R syntax: variables, vectors, and operations.
  4. Utilization of R Markdown for documentation.
  5. Effective handling of vectors and exploration of data frames and lists.
  6. Navigation of R packages: installation, loading, and usage.
  7. Skills in data import, visualization, and accessing help in RStudio.

Prerequisites

A computer with a stable internet connection is required. Any operating system (Windows, Mac, or Linux) is suitable, but Windows or Mac is recommended for the best experience.