Previous chapter
Case StudiesAustrian Vote
Next chapter

Austrian Vote ’17


Plot result of Austrian Vote as Barplot and Pie.

  1. Read vote17 from file data/06-plotting-07.rda using load()
  2. Convert the table from wide to long format, using Bundesland as id variable. Use the function gather() to accomplish the task.
  3. Use geom_bar() to plot a bar chart of the total result in Austria (Österreich). Use mutate() to convert the number of votes by 1000.
  4. Plot a barchart using geom_bar() showing votes by Bundesland. Hint: To adjust the x-axis labels you can use theme(axis.text.x=element_text(angle=90,hjust=1,vjust=0.5)).
  5. Plot a horizontal barchart by adding coord_flip().
  6. Plot (unstacked) bar chart faceted by Bundesland using facet_wrap(). Bonus: Try to reorder the parties factor by number of votes. Use the function fct_relevel() to change the factor ordering.

Data Source:Österreich_2017

load(file = "data/06-plotting-07.rda")

2. Plot Bar Chart

3. Plot Horizontal Bar Chart

4. Plot Bar Chart by Bundesland