Q:

How to parse both of these date formats?

Dates formatted as 4/29/2016 are parsed correctly, but dates formatted as 6242016 and 2042016 are not parsed. 
Does R think that some of the dates without the slash have day first instead of month? 
I've tried including dmy in lubrdiate and it still doesn't work.
I've tried looking at Sys.getlocale("LC_TIME") and it gives me "English_United States.1252".
demo$date <- as.character(demo$date)

demo <- demo %>%
      mutate(date = parse_date_time(date, "mdy"))

A:

You can wrangle your dates all into the same format using stringr. Then convert to numeric and use lubridate to parse.
library(stringr)
library(lubridate)

dates <- c("6242016", "2042016", "4/29/2016")
dates <- str_remove_all(dates, "/")
dates <- as.numeric(dates)

lubridate::mdy(dates)

# [1] "2016-06-24" "2016-02-04" "2016-04-29"

