title: Plotting monthly and annual data on the same graph using r
body: <p>I've plotted a dataframe containing multiple monthly variables of data (example data below) - this data is plotted monthly so there are 12 rows to the dataframe. I want to plot annual data on the same graph as daily dots on top of the monthly lines, but can't figure it out. </p>
  
  <pre><code>library(ggplot2)
  #generate monthly data
  df &lt;- data.frame(Month= seq(as.Date("2004/1/1"), by='month', length.out=12),
               data = (seq(1:12)), 
               data2 = ((12:1)))
  
  #melt the data together
  samplemelt &lt;- melt(df, id.vars='Month', variable.name ='Methods')
  
  #create daily data to plot also
  SampleData=data.frame(day=seq(as.Date("2004/1/1"), by='day', length.out=365),
                            data=rnorm(n=365,mean=6,sd=2))
  
  #plot the data             
  ggplot(samplemelt, aes(Month, value))+
    geom_line(aes(colour=Methods), size=1)
  </code></pre>
  
  <p>This plots the two lines, but I want to add the daily values as dots to the same plot. I've tried </p>
  
  <pre><code>ggplot(samplemelt, aes(Month, value))+
  geom_line(aes(colour=Methods), size=1)+
  geom_point(data=SampleData$data)
  </code></pre>
  
  <p>but this just gives an error <code>Error: ggplot2 doesn't know how to deal with data of class numeric</code></p>
  
  <p>Not sure if this is possible or if I'm missing something very obvious. Please help! </p>