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() +
labs(title="Number of Bills Passed Since 1980",x="Year",y="All Bills Passed") +
scale_fill_manual(values=c("blue","red"))
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.
(dat%>%
drop_na()%>%
filter(congress==110) %>%
ggplot(
aes(x=votepct,y=all_pass,color=Party)) +
geom_point() +
labs(title="Passage and Vote Pct., 110th Congress",x="Vote Pct.",y="All Pass") +
scale_color_manual(values=c("blue","red")) +
geom_smooth()) %>%
ggplotly()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
(dat%>%
drop_na()%>%
filter(congress==110) %>%
ggplot(
aes(x=dwnom1,y=all_pass,color=Party)) +
geom_point() +
labs(title="Passage and Ideology, 110th Congress",x="DW Nominate.",y="All Pass") +
scale_color_manual(values=c("blue","red")) +
geom_smooth(method=lm)) %>%
ggplotly()
## `geom_smooth()` using formula = 'y ~ x'
####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.
renderPlot(
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(title="Total Bills Passed by State Delegations, 110th Congress",x="Total Bills Passed Per State",y="State Name")
)