title: Do not know how to convert 'date' to class “Date”?
body: <p>Why do I get an error on RStudio for this line below:</p>
  
  <pre><code># Calculate the end day of current month.
  # example: 2016-07-31
  endDayOfCurrentMonth &lt;- as.Date(format(as.Date(format(as.Date(Sys.Date(),"%Y%m%d"), "%Y%m01"),"%Y%m%d") +31,"%Y%m01"), "%Y%m%d") -1
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>do not know how to convert 'date' to class “Date”</p>
  </blockquote>
  
  <p>In my RStudio console:</p>
  
  <pre><code>Listening on http://127.0.0.1:5097
  Warning in data.matrix(data) : NAs introduced by coercion
  Warning in data.matrix(data) : NAs introduced by coercion
  Warning in data.matrix(data) : NAs introduced by coercion
  Warning: Error in as.Date.default: do not know how to convert 'date' to class “Date”
  Stack trace (innermost first):
      105: as.Date.default
      104: as.Date
      103: filter
      102: _f [source/function/getStreamDf.R#46]
      101: withVisible
      100: rr
       99: renderPlot [/var/srv/shiny-server/dustboxes/dustbox1/server.R#91]
       89: &lt;reactive:plotObj&gt;
       78: plotObj
       77: origRenderFunc
       76: output$plot
        1: runApp
  </code></pre>
  
  <p>Any ideas?</p>