title: R automaticly changes dates' format
body: <p>My R changes format of dates to character or numeric.</p>
  
  <pre><code>For Example this code:
  x &lt;- as.Date("2018-06-20")
  cat(x)
  </code></pre>
  
  <p>will print <code>"2018-06-20"</code></p>
  
  <p>but This code:</p>
  
  <pre><code>x &lt;- as.Date("2018-06-20")
  foo &lt;- function(x) {
    cat(x)
  }
  foo(x)
  </code></pre>
  
  <p>will print a number <code>18433</code> and sometimes <code>"2018-06-20"</code> as character.</p>
  
  <p>Hot to fix it?</p>