Skip to content

Tutorial material for beginners to learn the basic principles of programming using the programming language R with a focus on data manipulation and visualization.

License

Notifications You must be signed in to change notification settings

Dr-Eberle-Zentrum/Introduction-to-programming-with-R

Repository files navigation

CC BY-SA 4.0

Introduction to programming with R

This repository holds an R package, which covers tutorials for a basic introduction to programming and data processing with R. It can be and is used both as self-study material or for tutored e-learning courses.

Available tutorials in recommended order

The tutorials are based on and extending chapters of the following text books

We thus recommend the following order

  • To get started
  • Data processing with the dplyr package
    • Workflow basics = Chapter 4 of R4DS
    • data-tibbles tutorial
    • dplyr-filter tutorial
    • dplyr-arrange-select tutorial
    • dplyr-mutate tutorial
    • dplyr-groupby-summarize tutorial
    • dplyr-sundries tutorial
  • Data import/export
    • data-io tutorial
    • data-tidy tutorial
  • String processing
    • stringr-regex tutorial
    • stringr-processing tutorial
  • Programming
    • coding-basics tutorial

The tutorials are summarized in our Aggregated Cheatsheet.

See below for instructions how to install and run the tutorials.

Requirements and local installation of tutorials

In order to run the tutorials you need to

  • install R (and RStudio) e.g. following this Tutorial Setting Up R
  • within R, you need to install the following packages
    • devtools - for local tutorial installation of our package from github
    • learnr - to run the tutorials
    • tidyverse - for the packages the tutorials are about
    • e.g. using install.packages( c("devtools","learnr","tidyverse") )

Afterwards, you can install or update our tutorial package from github via the following code.

# load packages
library(devtools)
library(learnr)
# install package from source
devtools::install_github("Dr-Eberle-Zentrum/Introduction-to-programming-with-R")

Using packageVersion("deztutr"), you can check the installed version, which is in YEAR-MONTH-DAY format. The recent version is listed in the DESCRIPTION file.

Note, some tutorials are based on additional data sets, so you better also install the following packages

  • nycflights13

by simply copying the following code into your console.

install.packages("nycflights13")

Running the tutorials

Before running the tutorials, you have to load the required packages.

library(learnr) # needed to run the tutorials
library(deztutr) # our package that contains the tutorials
library(tidyverse) # the topic the tutorials are about

Afterwards, you can list the available tutorials via

available_tutorials("deztutr")

or run a specific tutorial using

learnr::run_tutorial("first-steps", package = "deztutr")

Since the tutorial is started within your web browser, you might have to stop the session when you are done with studying the tutorial. This can be done with the red (STOP)-button in the RStudio "R Markdown" pane (upper right corner).

License

This work by Martin Raden is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

CC BY-SA 4.0

You are more than welcome to contribute and extend!

About

Tutorial material for beginners to learn the basic principles of programming using the programming language R with a focus on data manipulation and visualization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages