Q:

Quarterly Data - Convert Factor to Date

Unable to convert date column from factor to date type. I've tried base r and lubridate strategies:
> as.Date(df)
Error in as.Date.default(x, ...) : 
  do not know how to convert 'x' to class “Date”

> yq(df)
[1] NA
Warning message:
All formats failed to parse. No formats found. 

Data:
df<- structure(list(Date = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("2008-07-31", 
"2009-07-31", "2010-07-31", "2011-07-31", "2012-07-31", "2013-07-31", 
"2014-07-31", "2011-10-31", "2012-10-31", "2013-10-31", "2014-10-31", 
"2016-10-31", "2017-10-31"), class = "factor")), row.names = c(NA, 
6L), class = "data.frame")

A:

Apply as.Date to the Date column, not the entire data.frame.  No packages are used.
transform(df, Date = as.Date(Date))

giving:
        Date
1 2008-07-31
2 2008-07-31
3 2008-07-31
4 2008-07-31
5 2008-07-31
6 2008-07-31

