title: Convert quarter/year format to a date
body: <p>I created a function that coerce a vector of quarters-years format to a vector of dates. </p>
  
  <pre><code>.quarter_to_date(c("Q1/13","Q2/14"))
  [1] "2013-03-01" "2014-06-01"
  </code></pre>
  
  <p>This the code of my function.</p>
  
  <pre><code>.quarter_to_date &lt;-
    function(x){
      ll &lt;- strsplit(gsub('Q([0-9])[/]([0-9]+)','\\1,\\2',x),',')
  
      res &lt;- lapply(ll,function(x){
        m &lt;- as.numeric(x[1])*3
        m &lt;- ifelse(nchar(m)==1,paste0('0',m),as.character(m))
        as.Date(paste(x[2],m,'01',sep='-'),format='%y-%m-%d')
  
      })
      do.call(c,res)
    }
  </code></pre>
  
  <p>My function works fine but it looks long and a little bit complicated. I think that this should be already done in other packages( <code>lubridate</code> for example) But I can't find it. Can someone help me to simplify this code please? </p>