Lesson 2: Importing Data
The second R lecture builds on the foundation set in the first, beginning with a quick recap: viewers confirm their working directory and ensure the player_stats.csv file is correctly placed in that folder. The instructor reviews installing key packages like Tidyverse and Dplyr, then demonstrates how to read CSV data into R using read_csv(__), resulting in a clean, spreadsheet-like view in RStudio. The core of the lesson introduces two powerful functions from the Tidyverse: select(__) and mutate(__). Using select(__), users learn to remove unnecessary columns from the dataset, while mutate() allows them to create new statistics—such as field goal percentage—by combining existing data. The focus is on practical applications for sports analytics, emphasizing the importance of data cleaning and transformation in building custom stats.