Search⌘ K

Explore Our First Dataset

Explore the structure and contents of a large flight dataset in R using data frames. Understand how to load packages, view data summaries, and recognize key variables in the nycflights13 dataset to start your data analysis journey.

Let’s put everything we’ve learned so far into practice and start exploring some real data! Data comes to us in a variety of formats, from pictures to text to numbers. This is probably the most common way data is collected and saved in many fields. These spreadsheet-type datasets are called data frames in R. We’ll focus on working with data saved as data frames throughout this course.

Let’s first load all the packages needed for practice:

R
library(nycflights13)
# A package that seamlessly integrates code, data analysis, and text to create dynamic and reproducible reports and documents.
library(knitr)
# A package that simplifies data manipulation with intuitive functions, making it indispensable for data wrangling tasks.
library(dplyr)
print(flights)
  • Lines 1–7: We load three packages.

  • Line 9: We print the data frame.

The nycflights13 package

Air travel has become an ever-present aspect of many people’s lives. Many of us have ...