title: How to read quarterly data with R?
body: <p>I'm trying to use Bayesian VAR, but I can't even get my data right properly. I get them from <a href="https://sdw.ecb.europa.eu/" rel="nofollow noreferrer">https://sdw.ecb.europa.eu/</a> but since a lot of them are quarterly data I have a problem to merge my variables since I'm unable to convert for example &quot;2020-Q1&quot; from char to date with as.Date.</p>
  <p>I used the sub function to get 2020-1 for example and then tried <code>as.Date(, format=&quot;%Y-%q)</code> but it doesn't work, so I'm stuck.</p>
  <pre><code>textData &lt;- &quot;yearQuarter,Amount
  2019-Q1,1000
  2019-Q2,2000
  2019-Q3,3000&quot;
  
  df &lt;- read.csv(text=textData,header = TRUE,stringsAsFactors = FALSE)
  
  as.Date(df$yearQuarter,format=&quot;%Y-%q&quot;)
  </code></pre>
  <p>...which produces:</p>
  <pre><code>&gt; as.Date(df$yearQuarter,format=&quot;%Y-%q&quot;)
  [1] NA NA NA
  </code></pre>
  <p>Thank you for your help !</p>