title: Defining a date x-axis in a scatter plot (R)
body: <p>I want to produce a scatterplot of a dataframe which has a date column. The x axis should be monthly divided, or for each 2 months in the last 2 years.</p>
  
  <p><strong>The dataframe:</strong></p>
  
  <pre><code>code_1000 &lt;-
    as.data.frame(cbind(
      c("3", "3", "7", "7", "7", "7", "2", "2", "4", "4"),
      c("344", "344", "73", "73", "71", "72", "21", "27", "42", "43"),
      c("9-02-2017", "10-01-2016","9-02-2014", "25-03-2015", "9-02-2017",
        "10-06-2017", "8-04-2017", "25-08-2016", "07-08-2017", "15-09-2016"
      )
    ))
  names(code_1000) &lt;- c("number", "code", "date")
  </code></pre>
  
  <p><strong>The plot code:</strong></p>
  
  <pre><code>qplot(data=code_1000,
        x=format(as.Date(date),"%b/%Y"), 
        y=code,
        geom=c("point"),
        na.rm=TRUE,
        xlab="Emission date", ylab="Code",
        size=1, col=2)+theme_bw()+theme(legend.position="none")
  </code></pre>
  
  <p>I want to plot <code>code</code> on the y axis and <code>date</code> on the x axis. How can I force the x axis to be monthly divided? Also, when I run my plotting code, the x axis format looks like mm/dddd, but I want mm/yyyy. Why am I getting that format?</p>
  
  <p>I have ~50 dataframes like <code>code_1000</code> in a Shiny app.  To make things simpler, I'm not sharing all of the code.</p>
  
  <p>Thank you guys in advance!</p>