title: Plot a 24 hour cycle monthly for multiple variables?
body: <p>I have data that can be mimicked in the following manner:</p>
  
  <pre><code>set.seed(1234)
  
  foo &lt;- data.frame(month = rep(month.name, each = 24),
                hour = rep(seq(1:24), 12),
                value1 = rnorm(nrow(foo), 60, 1),
                value2 = rnorm(nrow(foo), 60, 1))
  
  foo &lt;- melt(foo, id = c('month', 'hour'))
  </code></pre>
  
  <p>I would like to create a plot for the entire year using ggplot that displays the 24 hour cycle of each variable per month.</p>
  
  <p>Here's what I've tried so far:</p>
  
  <pre><code>t.plot &lt;- ggplot(foo,
               aes(interaction(month,hour), value, group = interaction(variable,hour)))
  
  t.plot &lt;- t.plot + geom_line(aes(colour = variable))
  print(t.plot)
  </code></pre>
  
  <p>I get this, which throws the data into misalignment. For such a small SD you see that the first 24 values should be nearer to 60, but they are all over the place.  I don't understand what's causing this discrepancy. </p>
  
  <p><a href="https://www.dropbox.com/s/rv6uxhe7wk7q35w/foo.png" rel="nofollow">https://www.dropbox.com/s/rv6uxhe7wk7q35w/foo.png</a></p>
  
  <p>when I plot:</p>
  
  <pre><code>plot(interaction(foo$month,foo$hour)[1:24], foo$value[1:24])
  </code></pre>
  
  <p>I get the shape that I would expect however the xaxis is very strange and not what I was expecting.</p>
  
  <p>Any help?</p>