This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.

Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Ctrl+Shift+Enter.

library(readr) 
library(ggplot2)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyr)
library(scales)
## 
## Attaching package: 'scales'
## The following object is masked from 'package:readr':
## 
##     col_factor
setwd("C:/Users/pault/OneDrive - SUNY Canton/Clarkson/Coursework/IA640 - Information Visualization/Working Files")

SPD  <-read.csv("State_Park_Data_HW2.csv")

Summary of Data

setwd("C:/Users/pault/OneDrive - SUNY Canton/Clarkson/Coursework/IA640 - Information Visualization/Working Files")

SPD  <-read.csv("State_Park_Data_HW2.csv")


summary(SPD)
##       Year      OPRHP.Region          County            Facility        
##  Min.   :2003   Length:5253        Length:5253        Length:5253       
##  1st Qu.:2008   Class :character   Class :character   Class :character  
##  Median :2014   Mode  :character   Mode  :character   Mode  :character  
##  Mean   :2014                                                           
##  3rd Qu.:2019                                                           
##  Max.   :2024                                                           
##    Attendance     
##  Min.   :      0  
##  1st Qu.:  20542  
##  Median :  64942  
##  Mean   : 275242  
##  3rd Qu.: 205042  
##  Max.   :9596491
SPD
ParkA <-  filter(SPD, Attendance == 0) %>%
  group_by(Year, OPRHP.Region) %>%
  summarize(count = n())
## `summarise()` has grouped output by 'Year'. You can override using the
## `.groups` argument.
p <- ggplot(data = ParkA, mapping = aes(x = Year, y = count, fill = NULL))+
 geom_col()+
  labs(title = "New York State Parks with Zero Attendance", subtitle = "2003 - 2024", x = NULL, y = "Number of Counties", caption=" source:https://data.ny.gov/")+
  theme_minimal()

p