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() +
    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.

Page 2

Contents

What is a Republican?: A Republican generally refers to a member or supporter of the Republican Party, which is one of the two major political parties in the United States. The Republican Party is often associated with conservative and right-leaning ideologies. It was founded in 1854, and its platform has evolved over time.


What is a Democrat: A Democrat refers to a member or supporter of the Democratic Party, which is one of the major political parties in the United States. The Democratic Party is one of the two dominant political parties in the country, alongside the Republican Party.


The importance of the Republican and Democrats in the American System: The Republican and Democratic parties are integral to the American political system, providing a structure for representation, competition, and policy development. Their presence helps maintain a balanced and dynamic political environment, contributing to the stability and functionality of the U.S. government.


The importance of the bills passed: The importance of bills passed in America lies in their role in shaping laws, policies, and regulations that govern the nation. They are a fundamental aspect of the democratic process, representing the will of the people through their elected representatives and addressing the complex challenges faced by society.

library(knitr)
renderImage(
#list(src = "C:/Users/Matthew/Desktop/Johns Hopkins Data Visualization & Dashboarding/5 - Data Visualization Capstone/TRUMP.png",contentType = 'image/png',
  list(src = "TRUMP.png",contentType = 'image/png',
         width = 300,
         height = 300,
     deleteFile=FALSE)
)

Page 3

Column

Chart C

(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'

Column

Chart D

(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'

Page 4

Column

####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")
  
)