Course: Data-Driven Management and Policy

Prof. José Manuel Magallanes, PhD


Session 3: Data Structures

Before starting, keep in mind the following ideas:

We are going to talk about 3 data structures in R:

  1. Lists.
  2. Vectors.
  3. Data Frame.

Lists and vectors are simple structures; a data frame is a more complex one (built from the simple ones).


List

Lists are containers of values. The values can be of any kind (numbers or non-numbers), and even other containers (simple or complex).

If we have an spreadsheet as a reference, a row is a ‘natural’ list.