convert year-month string into daily dates
<p>recently I asked how to convert calendar weeks into a list of dates and received a great and most helpful answer: 
<a href="https://stackoverflow.com/questions/35071009/convert-calendar-weeks-into-daily-dates">convert calendar weeks into daily dates</a></p>

<p>I tried to apply the above method to create a list of dates based on a column with "year - month". Alas i cannot make out how to account for the different number of days in different months.
And I wonder whether the package lubridate 'automatically' takes leap years into account?</p>

<p>Sample data:</p>

<pre><code>df &lt;-  data.frame(YearMonth = c("2016 - M02", "2016 - M06"), values = c(28,60))
</code></pre>

<p>M02 = February, M06 = June (M11 would mean November, etc.)</p>

<p>Desired result:</p>

<pre><code>DateList  Values
2016-02-01  1
2016-02-02  1
ect
2016-02-28  1
2016-06-01  2
etc
2016-06-30  2
</code></pre>

<p>Values would something like </p>

<pre><code>df$values / days_in_month()
</code></pre>

<p>Thanks a million in advance - it is honestly very much appreciated!</p>