Prerequisites
Participants must be able to use a laptop/computer capable of running
recent RStudio.
See below for the RStudio Installation
section.
Teachers
- Szymon M. Kiełbasa (s.m.kielbasa@lumc.nl)
- Ramin Monajemi (r.monajemi@lumc.nl)
- Mo Arkani (correspondence m.arkani@lumc.nl)
What we teach
R is an open-source, free
environment/language for statistical computing and graphics. It provides
a large repository of statistical analysis methods.
The goal of the course is to teach you how the R language, extended
by tidyverse package, can be
used to build a report with a simple statistical
analysis of data provided in a table. The course assumes no
prior programming knowledge.
NOTE: This is not a statistics course! We do not
teach statistics; we teach how to write simple programs in the R
language. Elementary statistics knowledge is necessary to understand
examples.
After the course you will:
- Read and write (
tidyverse
-based) R code.
- Know where to look for R methods to perform statistical analyses of
your own data.
- Generate reproducible reports from your own data in HTML, PDF or DOC
formats.
We will cover the following topics:
- R expressions.
- R data objects: vectors, data frames (tibbles), lists,
(matrices).
- R Markdown for building
reproducible reports.
- Data manipulation: filtering, sorting, summarising of a table;
joining/merging multiple tables (with tidyverse/dplyr and tidyverse/tidyr).
- Visualisation: scatter plots, histograms, boxplots (with tidyverse/ggplot2).
- R packages: installation and usage.
Course structure
The course takes up 4 half-day sessions, each session is split into a
few small topics and each topic is introduced as follows:
- A short lecture for introduction/demonstration.
- Followed by a practical (with primary exercises end
extra exercises).
The students are asked to type on their keyboards the
commands being presented and observe effects (avoid
copy-paste; own typing is important in order to learn how to
respond to mistakes/errors).
Self-study assignment
A self-study assignment (SSA) will be offered at the
end of the last session. The goal of the SAA is to prepare you for the
exam. The overall SSA procedure is to prepare an R Markdown document
reporting an analysis of a dataset.
Installation
Installation of R and RStudio software, including additional
packages, is required before the start of the course. Please follow the
instructions below.
NOTE: Resolving installation problems during the
course may be impossible, therefore please follow the steps below a week
before the start of the course. In case of failure, please inform the
teachers. In some situations intervention of the administrator of your
computer might be necessary.
- Install R: go to the R Project for Statistical
Computing (https://www.r-project.org/) and follow the download and
installation instructions.
- Install RStudio: go to the RStudio download page
(https://www.rstudio.com/products/rstudio/download/#download),
select a version of RStudio appropriate for your laptop, download it and
then install. Please check whether you can start RStudio.
- CAUTION LUMC Windows users: Installation of the R
software via the LUMC Software Center is strongly recommended (instead
of via the R websites above). This should avoid the following problem:
Programs, such as R and RStudio may be installed on LUMC network drives
instead of local drive ‘C:’. In that case some functionalities may fail,
in particular generation of R Markdown reports. A solution is to force
the installation on your local drive such as ‘C:’, this however, may
require administrator privileges which you may not have. Alternatively
you may consider a separate laptop which is not administered on LUMC
network for the time being and try to resolve the issue later with your
system administrator.
Some additional packages are needed for the course. During the course
the participants will learn how to install packages but this process
occasionally fails (because e.g.: additional steps are needed in a
particular operating system, or there is lack of permissions to access
some system directories, or other software is too old, …).
- Install tidyverse package: Start RStudio. Go to
menu Tools/Install Packages… In the field Packages select tidyverse.
Press Install. (Now, a lot of messages will be shown in the Console
window - wait till it finishes). In the Console window type library(
tidyverse ) and press Enter. Some messages might be displayed but when
there is no error the installation is completed.
- Install packages needed for R Markdown: Start
RStudio. Go to menu File/New File/R markdown…. A New R Markdown window
is displayed. Press OK. Now, in case of missing R Markdown packages, you
will be asked to install them. Finally, you will see an editor window
with Untitled1 header. Put the cursor in that window, then click Knit.
Some messages might be displayed but when later a window with some text
and a plot is shown the installation is completed. During the course
applications in multiple windows will be used. For better experience we
advice a setup with two monitors (e.g. laptop and an external
monitor).
Copyright © 2024 Biomedical Data Sciences (BDS) | LUMC