R for absolute beginners

Please note: These pages are under construction! That is a permanent condition, but at the moment they are under more construction than they will ever be.

We are busy adjusting time-estimates, removing material that will not be covered in our traing-sessions, and adding material that WILL be covered in our training sessions. So - please have patience, we will get there!

The aim of KUB-Datalab is to teach students, teachers and researchers basic concepts, skills and tools for working with data so they can get more done in less time. And with less pain.

The lessons below have been cripped from the Data Carpentries lesson in working with social sciences data in R, but have been scaled down for time, and adjusted to be generally applicable, in all sciences.

This is an introduction to R, designed for learners with no programming experience. The lessons can be taught in about 2 to 2½ hours. They start with some basic information on the syntax of R, the interface to RStudio, and move on to how to import CSV files, the structure of data frames, how to manipulate them and calculate summary statistics.

Logical structures and loops are introduced, and defining your own functions briefly mentioned.

Getting Started

Our teaching is hands-on, so participants are encouraged to use their own computers to ensure the proper setup of tools for an efficient workflow.

These lessons assume no prior knowledge of the skills or tools.

To get started, follow the directions in the “Setup” tab to download data to your computer and follow any installation instructions.

Prerequisites

This lesson requires a working copy of R and RStudio, or access to Rstudio.cloud.
To most effectively use these materials, please make sure to install everything before working through this lesson.

For Instructors

If you are teaching this lesson in a workshop, please see the Instructor notes.

Schedule

Setup Download files required for the lesson
00:00 1. Before we Start How to find your way around RStudio?
How to interact with R?
How to manage your environment?
How to install packages?
00:15 2. Introduction to R What data types are available in R?
What is an object?
How can values be initially assigned to variables of different data types?
What arithmetic and logical operators can be used?
How can subsets be extracted from vectors?
How does R treat missing values?
How can we deal with missing values in R?
00:55 3. Starting with Data What is a data.frame?
How can I read a complete csv file into R?
How can I get basic summary information about my dataset?
01:35 4. Data Wrangling with dplyr and tidyr How can I select specific rows and/or columns from a dataframe?
How can I combine multiple commands into a single command?
How can I create new columns or remove existing columns from a dataframe?
How can I reformat a dataframe to meet my needs?
02:05 5. A couple of plots. And making our own functions How do I create scatterplots, boxplots, and barplots?
How can I define my own functions?
04:00 6. What is the next step? What do I do now?
What is the next step?
04:10 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.