title: Trouble formatting multiple date styles with lubridate
body: <p>I am formatting one column that contains the date of a record. In the column there are many formats of the date and I need to convert them into one consistent format. </p>
  
  <p>I tried using lubridate()and the parse_date_time() function.
  I also tried with the column as a character and as a factor</p>
  
  <p>This is what the date column looks like (with over 100,000 rows)</p>
  
  <pre><code>Date.of.Record 
  2018-01-01     
  20180102     
  2018/01/03  
  2018-01-04  
  2018-01-05
  20180106 
  </code></pre>
  
  <p>And id like to format them to this:</p>
  
  <pre><code>Date.of.Record 
  20180101     
  20180102     
  20180103  
  20180104  
  20180105
  20180106 
  </code></pre>
  
  <p>And this  its the code I tried:</p>
  
  <pre><code>library(lubridate)
  date &lt;- parse_date_time(bind$Date.of.Record, orders =c(ymd()))
  date2 &lt;- as.Date(bind$Date.of.Record, "%yyyy-%mm-%dd")
  </code></pre>
  
  <p>The code for 'date" doesn't work at all and the code for 'date2' produces all NAs.</p>
  
  <p>I realize that I could subset the data into different datasets by date format then combine after I format properly, but I expect there is a much more efficient way to do this. I am still new to R and try to learn the best way to work with large datasets</p>
  
  <p>Thanks for your help!!!</p>