title: “Peer Review Three” output: flexdashboard::flex_dashboard: orientation: columns vertical_layout: fill runtime: shiny —

Page 1

Chart A

dat2 <- dat %>% 
  drop_na() %>% 
  filter(year>1979) %>% 
  group_by(year,Party) %>% 
  summarise(passed=sum(all_pass))%>%
  select(year, Party, passed)
## `summarise()` has grouped output by 'year'. You can override using the `.groups` argument.
  ggplot(dat2, aes( year, passed, fill = Party))+geom_density(stat="identity")+ scale_fill_manual(values = c("blue", "red"))+ggtitle("Number of bill passed since 1980")+ ylab("All bill passed")

Page 2

Chart B

dat%>%
  drop_na()%>%
  filter(congress==110) %>%
  ggplot(aes(x= votepct, y=all_pass, color = Party))+geom_point()+ scale_color_manual(values = c("blue", "red"))+ geom_smooth()+labs(title = "Passage and Vote Pct., 110th Congress", x = "Vote Pct", y="All Pass"
)
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

Chart C

dat%>%
  drop_na()%>%
  filter(congress==110) %>%
  ggplot(aes(dwnom1, all_pass, color = Party))+geom_point()+geom_smooth(method = lm)+ scale_color_manual(values = c("blue", "red"))+ggtitle("
Passage and Ideology, 110th Congress")
## `geom_smooth()` using formula 'y ~ x'

Page 3

Chart D

####hint: this figure uses selectInput with the multiple option set to true and with the options set up so that all states are initially selected.


dat %>% 
  group_by(st_name) %>% 
  filter(congress==110) %>%
  summarise(passed=sum(all_pass))%>%
  ggplot( aes(x = passed, y = st_name))+geom_bar(stat="identity") + labs(x= "Total Bills Passed Per State", y = "State Name")