title: guess_formats + R + lubridate
body: <p>I'm having trouble understanding how to use the guess_formats function in lubridate. I have a vector of dates in some unknown set/order of formats. I'd like to convert them to a Date object (or at least convert as many as possible). The following code is what I've tried:</p>
  
  <pre><code>library(lubridate)
  sampleDates &lt;- c("4/6/2004","4/6/2004","4/6/2004","4/7/2004",
          "4/6/2004","4/7/2004","2014-06-28","2014-06-30","2014-07-12",
          "2014-07-29","2014-07-29","2014-08-12")
  formats &lt;- guess_formats(sampleDates, c("Ymd", "mdY"))
  dates &lt;- as.Date(sampleDates, format=formats)
  </code></pre>
  
  <p>This gives all NA's.</p>
  
  <p>This is obviously just a short example. In the real case, I wouldn't know where the various formats are scattered about, and I wouldn't be 100% sure there are only %m/%d/%Y and %Y-%m-%d. Could someone let me know either A. how would guess_formats be used in this example or B. is there something more appropriate to use in lubridate/base R, hopefully without a lot of regex'ing. Thanks!</p>
  
  <p>Edit:
  I've also tried parse_date_time. What I don't understand is the following works for this example:</p>
  
  <pre><code>parse_date_time(sampleDates,
              orders = c("Ymd", "mdY"),
              locale = "eng")
  </code></pre>
  
  <p>But this does not:</p>
  
  <pre><code>parse_date_time(sampleDates,
              orders = c("mdY", "Ydm"),
              locale = "eng")
  </code></pre>
  
  <p>In my actual set of data, I will not know the order of the formatting, which seems to be important for this function.</p>
  
  <p>Double Edit: Dur, OK, I see I had Ymd in the first parse_date_time example and Ydm in the second...carry on.</p>