{"metadata":{"kernelspec":{"name":"ir","display_name":"R","language":"R"},"language_info":{"name":"R","codemirror_mode":"r","pygments_lexer":"r","mimetype":"text/x-r-source","file_extension":".r","version":"4.0.5"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# For the NFL Big Data Bowl 2022, I have decided to analyze the number of yards returned by player across games during the 2018 season. #","metadata":{}},{"cell_type":"code","source":"install.packages('tidyverse')\nlibrary(tidyverse)","metadata":{"execution":{"iopub.status.busy":"2022-01-07T06:02:14.700965Z","iopub.execute_input":"2022-01-07T06:02:14.703011Z","iopub.status.idle":"2022-01-07T06:02:34.073210Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tracking2018_no_duplicates <- read.csv(\"../input/tracking2018-no-duplicates/tracking2018_no_duplicates.csv\")","metadata":{"execution":{"iopub.status.busy":"2022-01-07T06:02:56.165935Z","iopub.execute_input":"2022-01-07T06:02:56.167709Z","iopub.status.idle":"2022-01-07T06:02:56.186983Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"colnames(tracking2018_no_duplicates)","metadata":{"execution":{"iopub.status.busy":"2022-01-07T06:02:59.057353Z","iopub.execute_input":"2022-01-07T06:02:59.059256Z","iopub.status.idle":"2022-01-07T06:02:59.077758Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plays <- read.csv(\"../input/nfl-big-data-bowl-2022/plays.csv\")","metadata":{"execution":{"iopub.status.busy":"2022-01-07T06:03:11.360099Z","iopub.execute_input":"2022-01-07T06:03:11.361828Z","iopub.status.idle":"2022-01-07T06:03:11.554730Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"colnames(plays)","metadata":{"execution":{"iopub.status.busy":"2022-01-07T06:03:16.726875Z","iopub.execute_input":"2022-01-07T06:03:16.728524Z","iopub.status.idle":"2022-01-07T06:03:16.744005Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"nfl_kick_return_yardage_by_player <- merge(plays, tracking2018_no_duplicates, by = \"gameId\")","metadata":{"execution":{"iopub.status.busy":"2022-01-07T06:03:34.474287Z","iopub.execute_input":"2022-01-07T06:03:34.475904Z","iopub.status.idle":"2022-01-07T06:03:34.490792Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"head(nfl_kick_return_yardage_by_player)","metadata":{"execution":{"iopub.status.busy":"2022-01-07T06:03:38.704427Z","iopub.execute_input":"2022-01-07T06:03:38.706093Z","iopub.status.idle":"2022-01-07T06:03:38.754734Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ggplot(data=nfl_kick_return_yardage_by_player, aes(x = displayName, y = kickReturnYardage, color= displayName)) + geom_point() + geom_smooth() + labs(title = \"Yards Returned based on Player\", caption = \"This compares the yards depending on which player is returning the ball\")\n","metadata":{"execution":{"iopub.status.busy":"2022-01-07T06:15:59.004962Z","iopub.execute_input":"2022-01-07T06:15:59.006882Z","iopub.status.idle":"2022-01-07T06:15:59.795209Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### It looks like Sebastian Janikowski had the most yards in a game in 2018, but Justin Tucker seems to have the most consistent increase in kick return yardage across games. ###","metadata":{}}]}