Dashboard

Page 1

Chart A

dat %>% 
  drop_na() %>% 
  filter(year>1979) %>% 
  group_by(year,Party) %>% 
  summarise(passed=sum(all_pass)) %>% 
  ggplot(aes(x = year, y = passed, fill = Party))  + 
  geom_area(position = 'stack') + 
  scale_fill_manual(values= c("blue", "red")) + 
  ggtitle("Number of Bills Passed Since 1980") + 
  labs(x = "Year", y = "All Bills Passed")
`summarise()` has grouped output by 'year'. You can override using the
`.groups` argument.

Page 2

Column

Chart B

renderPlotly(
  ggplotly(
    dat%>%
    drop_na()%>%
    filter(congress==110) %>%
    ggplot(aes(x = votepct, y = all_pass,color = Party))+ 
    geom_smooth() +  
    geom_point()+
    scale_color_manual(values= c("blue", "red")) + 
    ggtitle("Passage and Vote Pct., 110th Congress") + labs(x = "Vote Pct.", y = "All Pass")
  )
)

Column

Chart C

renderPlotly(
  ggplotly(
    dat%>%
    drop_na()%>%
    filter(congress==110) %>%
    ggplot(aes(x = dwnom1, y = all_pass,color = Party)) + 
    geom_smooth(method = "lm") + 
    geom_point()+
    scale_color_manual(values= c("blue", "red")) + 
    ggtitle("Passage and Ideology, 110th Congress") + 
    labs(x = "DW Nominate.", y = "All Pass")
  )
)

Page 3

Column

renderPlot(height = 750,
           dat %>%
             group_by(st_name) %>%
             filter(congress == 110) %>%
             summarise(passed = sum(all_pass)) %>%
             filter(st_name %in% input$states) %>%
             ggplot(aes(y = st_name, x = passed)) +
             geom_bar(stat = "identity") +
             labs(title = "Total Bills Passed by State Delegations, 110th Congress", x = "Total bills Passed Per State", y = "State Name"))