title: Trying to combine multiple datasets into one bar graph in R
body: <p>I'm trying to create a bar graph that has the same variables on the x-axis except separated by year. I want to show an increase/decrease over time but I'm not sure how to insert each dataset into the graph and have the years labelled.  Each dataset is election results from a specific year. </p>
  
  <p>Here's one dataset for example: </p>
  
  <blockquote>
    <p><code>1992Election</code><br>
     Political  Party           18-29,30-44,45-59,60+  (the numbered headings are age groups)<br>
    Democrat      0.40,0.37,0.40, 0.47  (voting percentages)<br>
    Republican  0.35,0.41,0.42, 0.47</p>
  </blockquote>
  
  <p>For the first dataset I have the following code to create one bar graph:</p>
  
  <p><strong>1992Election</strong></p>
  
  <pre><code>colnames(`1992Election`)[colnames(`1992Election`)=="X.18.29."] &lt;- "18-29"
  colnames(`1992Election`)[colnames(`1992Election`)=="X.30.44."] &lt;- "30-44"
  colnames(`1992Election`)[colnames(`1992Election`)=="X.45.59."] &lt;- "45-59"
  colnames(`1992Election`)[colnames(`1992Election`)=="X.60.."] &lt;- "60+"
  
  Party92 = rownames(`1992Election`)
  n.group92 = nrow(`1992Election`)
  
  color.names92 = c("royalblue2", "red2")
  
  barplot(as.matrix(`1992Election`),beside = TRUE, xlab = "Age Group", 
          ylab = "Percent Voted", ylim = c(0,.7), col = color.names92)  
  title(main = "Presidential Election Votes by Age in Ohio\n Year 1992")
  legend("topright", title = "Political Party", Party92, fill = color.names92, 
    cex = 0.4)
  </code></pre>
  
  <p>this results in this graph: <a href="https://i.stack.imgur.com/F9EKy.png" rel="nofollow noreferrer">1992Electiongraph</a></p>
  
  <p>I would like to have the same variables along the x axis but grouped together by year</p>
  
  <p>For ex: X- axis [the age groups (1992), [same age groups (1996), etc] if that makes sense, thanks.</p>