Hands-on Data Science
My learning DE

Slides45 min

Vectors and data frames

How R holds data: vectors of exactly one type, comparing and picking position by position, missing values and factors, the data frame as a list of equally long vectors and the tibble as the table of the tidyverse, shown on the game with three doors.

Topics:Programming with R

What you will learn

This deck shows you on the game with three doors how R holds data in vectors and tables, and afterwards you can:

  • explain why a vector holds values of one type only and how R converts when types are mixed
  • recognise the types double, integer, character and logical with typeof()
  • compare two vectors position by position and count and compute shares with sum() and mean() of a logical vector
  • pick values of a vector with [ ] by position and by a condition
  • describe a data frame as a list of equally long vectors and read data as a tibble with read_csv() and look at it with glimpse()
In a new window As PDF
Back
More on this
Details
Level
Beginner
Modules
Empirical Research
In learning paths
Getting started with R
Code
5231
Updated
3 November 2026
Status
published

    A four-digit code takes you straight to the item.