title: Is my table the cause of my grouped barplots weird formating?
body: <p>So I am very new to R, and am not very sure what my problem is.</p>
  <p>So my data looks something like this:</p>
  <pre><code>|Time  | Gender | School |
  |:-----|:-------|:-------|
  |44    |   m    | SB     |
  |57    |   m    | DN     |
  |53    |   m    | K      |
  |48    |   m    | N      |
  |45    |   f    | SB     |
  |50    |   f    | DN     |
  |49    |   f    | K      |
  |43    |   f    | N      |
  </code></pre>
  <p>I got this data in an <code>data.frame(run_data)</code>, where a lot more data is stored, this would be <code>run_data[9:16, ]</code>.</p>
  <p>Now I want my barplot to use the time as an y-axis, and have the Schools grouped together (on the x-axis) with a bar for each gender.
  I tried:</p>
  <pre><code>barplot(table(run_data[9:16, ]$Time, run_data[9:16, ]$School) beside=TRUE)
  </code></pre>
  <p>And School first, then time, both times I got a weird graph, where nothing was grouped, and the y-axis was 0-1.</p>
  <p>I thought the problem was that the school column is a character column, so I changed it to an factor, and them numeric. When opened through <code>fix(run_data)</code> it had changed the names to 1, 2, 3, or 4, but when I used barplot, it was still the same weird thing.</p>
  <p>This it what it looks like when Time is first:
  <a href="https://i.stack.imgur.com/sI3ZC.png" rel="nofollow noreferrer">Time first</a></p>
  <p>And this when School is first:
  <a href="https://i.stack.imgur.com/gvnm4.png" rel="nofollow noreferrer">School first</a></p>
  <p>My best guess is that the table is somehow wrong, but I am not sure how. Help would be great, and if possible with just basic R, it would be even greater. :)</p>