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.
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,characterandlogicalwithtypeof() - compare two vectors position by position and count and compute shares with
sum()andmean()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
tibblewithread_csv()and look at it withglimpse()
Details
- Level
- Beginner
- Modules
- Empirical Research
- In learning paths
- Getting started with R
- Code
5231- Updated
- 3 November 2026
- Status
- published