Statistiek: Introductie tot R (2021–2022)

Lieven Clement · Universiteit Gent

Deze cursus is enkel voor studenten van de bachelor in de biologie, bachelor in de biochemie en biomedische wetenschappen, bachelor in de biomedische wetenschappen en de bachelor in de chemie en hoort bij de opleidingsonderdelen Statistiek en Inleiding tot de Biostatistiek. Andere geïnteresseerden kunnen zich inschrijven in de publieke cursus R Basics.

In this interactive course you will build a foundation in R and learn the basics to wrangle data. The course is based on the first part of the e-book Introduction to Data Science authored by Prof. Rafael Irizarry, Department of Data Sciences at the Dana-Farber Cancer Institute and Department of Biostatistics Harvard School of Public Health.

You are currently not able to subscribe to this course.

Register

Exercise series

Prologue
October 13, 2021 23:00

Title Class progress
Preface
Acknowledgments
Introduction

Installing R and Rstudio
October 13, 2021 23:00

The instructions below include screen shots from the installation process in which we used the Chrome browser which, although not necessary, you can freely download and install from here: https://www.google.com/chrome/.

Title Class progress
36.1 Installing R
36.2 Installing RStudio

1. Getting started with R and RStudio
October 13, 2021 23:00

In this book, we will be using the R software environment for all our analysis. You will learn R and data analysis techniques simultaneously. To follow along you will therefore need access to R. We also recommend the use of an integrated development environment (IDE), such as RStudio, to save your work. Note that it is common for a course or workshop to offer access to an R environment and an IDE through your web browser, as done by RStudio cloud. If you have access to such a resource, you don’t need to install R and RStudio. However, if you intend on becoming an advanced data analyst, we highly recommend installing these tools on your computer. Both R and RStudio are free and available online. We suggest to develop your code for the exercises in RStudio and to paste your script in dodona to evaluate them.

Title Class progress Status
1.1. Why R?
1.2. The R console
1.3. Scripts
1.4. RStudio
1.5. Installing R packages

2. R Basics
October 13, 2021 23:30

Title Class progress Status
2.1 Case study: US Gun Murders
2.2 The very basics
2.3.1 Sum of integers 1, .., 100
2.3.2 Nested functions
2.4 Data types
2.5.1 Dataframe exploring
2.5.2 Examining Variables
2.5.3 Multiple ways to access variables
2.5.4 Factors
2.5.5 Tables
2.6 Vectors
2.7.1-5 Vectors
2.7.6 Vector of numbers 12..73
2.7.7 Odd numbers
2.7.8 Length of a sequence
2.8 Coercion
2.9.1 Vector cast
2.10 Sorting
2.11.1-4. Examining Dataframes
2.11.5-6. Editing Dataframes
2.12 Vector arithmetics
2.13.1 Convert Temperatures
2.13.2 Vector Sum
2.13.3 Vector Mean
2.14 Indexing
2.15.1 NA
2.15.2-6. Dataframe operations

These exercises are extra and therefore optional!

Title Class progress Status
2.14.6. Match function
2.14.7-8. Match operator

3. Programming basics
October 13, 2021 23:30

Title Class progress Status
3.0 Introduction
3.1 Namespaces
3.2 Defining functions
3.2.1 Define function
3.3 Conditional expressions
3.3.1 Conditional Expressions
3.3.2 Ifelse
3.4 For-loops
3.4.0 For loops common mistake
3.4.1 For loops
3.5 Vectorization and functionals
3.5.1 Apply family
3.5.2 Simulate the chance
3.5.3 Simulate the chance II

These exercises are extra and therefore optional!

Title Class progress Status
3.6.1 Conditional expression
3.6.2 Any and all
3.6.3 Conditional changes
3.6.4 Sum of the first n integers
3.6.5 Functions with multiple variables
3.6.6 Namespace
3.6.7-8 Sum of the first n squares (I)
3.6.9 Sum of the first n squares (II)

4. The Tidyverse
October 20, 2021 23:30

Title Class progress Status
4.1 Tidy data
4.1.1 CO2
4.1.2 Weight
4.1.3 BOD
4.2 Manipulating data frames
4.2.1-3 Dataframe column operations
4.2.4-6 Dataframe row operations
4.2.7 Dataframe mixed operations
4.3 The pipe: %>%
4.3.1 Pipes
4.4 Summarizing data
4.4.1 Summarizing
4.4.2 Grouping
4.5 Sorting data frames
4.5.1 Sorting
4.6 Tibbles
4.6.1 Tibbles 1
4.7 The dot operator
4.8 do
4.9 Tidyverse conditionals
4.9.1 Tidyverse conditionals

These exercises are extra and therefore optional!

Title Class progress Status
4.13 The purrr package

5. Importing Data
October 27, 2021 23:30

Title Class progress Status
5.0 Introduction
5.1 Paths and the working directory
5.2 The readr and readxl packages
5.2.1 Paths
5.3 Downloading files
5.3.1 Spreadsheets
5.4 R-base importing functions
5.5 Organizing data with spreadsheets
5.5.1 Lost column headers
5.5.2 Spreadsheets without extension

6. Introduction to data visualization

Title Class progress Status
6.0 Introduction to data visualization

7. ggplot2
October 27, 2021 23:30

Title Class progress Status
7.0 Introduction
7.1 The components of a graph
7.2 ggplot objects
7.2.1 Creating a ggplot object
7.2.2 Printing a ggplot object
7.3 Geometries
7.4 Aesthetics
7.4.1 Mapping aesthetics
7.4.2 Setting vs mapping aesthetics
7.5 Layers
7.5.1 GGPlot extra layer
7.6 Global versus local aesthetic
7.7 Scales
7.8 Labels and titles
7.8.1 GGPlot scales and axes
7.9 Categories as colors
7.10 Annotation, shapes, and adjustments
7.11 Add-on packages
7.12 Putting it all together