title: How to convert R date() values
body: <p>I've got a dateframe with a lot of dates in it that were generated by the date() command in R, resembling the first dataframe below. On my computer with this version of R, the date values are formatted like this &quot;Thu Mar 18 11:15:23 2021&quot; - I believe this is all base R stuff.</p>
  <p>I want to strip the weekday, the hours, minutes, and seconds away, and then transform it so that it looks like this &quot;2021-03-18&quot;. My goal dataframe is the second dataframe below.  I've tried various as.Date() or strftime functions to no avail.</p>
  <pre><code>df &lt;- data.frame(date=c(date(),date()),value = c(1,2))
  </code></pre>
  <pre><code>df &lt;- data.frame(date =c(&quot;2021-03-18&quot;,&quot;2021-03-18&quot;), value = c(1,2))
  </code></pre>