Attendance Data

While exploring through the NFL attendance data, it would be a good analysis to find range of what exactly the average attendance is for every team, and to see what teams tend to have more fans, what outliers there are, etc. For that below boxplot has been created to visualize the data.

Boxplot of Attendance per Team

Summary

While visualizing the data, it appears that the highest mean goes to the New York Giants, followed closely by the New York Jets and Washington Redskins. There is a range of values that almost all teams appear to be around between 60,000 and 80,000 fans. Only San Francisco 49ers, Arizona Cardinals, Dallas Cowboys, Philadelphia Eagles and New York Giants have crossed highest weekly attendance of 100,000 threshold.

---
title: "Homework 4"
author: "Sourav Karwa"
output: 
  flexdashboard::flex_dashboard:
    source_code: embed
    social: menu
    theme: cerulean
    vertical_layout: scroll
---

### Attendance Data


```{r loading data, echo = FALSE}
suppressMessages(library(tidyverse))
suppressMessages(library(ggplot2))
attendance_data_nfl <-read_csv("D:\\Academic\\FallSem\\Data_wrangling_BANA_7025\\Assignment\\attendance.csv")

```

While exploring through the NFL attendance data, it would be a good analysis to find range of what exactly the average attendance is for every team, and to see what teams tend to have more fans, what outliers there are, etc. For that below boxplot has been created to visualize the data.

### Boxplot of Attendance per Team

```{r ploting data, echo = FALSE}
attendance_data_nfl %>%
  mutate(week = factor(team_name)) %>%
  ggplot(aes(team_name, weekly_attendance, fill = team_name)) +
  geom_boxplot(show.legend = FALSE, outlier.alpha = .5)+
  theme(axis.text.x = element_text(angle = 90))+
  labs(x = "Team Name",
    y = "Weekly NFL game attendance"
  )

```


### Summary

While visualizing the data, it appears that the highest mean goes to the _New York Giants_, followed closely by the _New York Jets_ and _Washington Redskins_. There is a range of values that almost all teams appear to be around between 60,000 and 80,000 fans. Only _San Francisco 49ers_, _Arizona Cardinals_, _Dallas Cowboys_, _Philadelphia Eagles_ and _New York Giants_ have crossed highest weekly attendance of 100,000 threshold.