Convert character to date vector (!bY) in R : <p>I am trying to convert a character vector of dates (in the format: i.e. "Jan.1990") to a date vector (keeping a similar format: i.e. "Jan 1990" or "Jan.1990"). </p>

<pre><code>month_year &lt;- ("Jan.1990", "Feb.1990", "Mar.1990", "Jan.1991", "Feb.1991", Mar. 1991")
</code></pre>

<p>I have tried using as.Date and various commands with the lubridate package but I either end up with an incorrect format or NAs. </p>

<p>I tried using as.Date:</p>

<pre><code>df$month_year &lt;- as.Date(df$month_year,format = "%b%Y")
</code></pre>

<p>This resulted in NAs.</p>

<p>I tried lubridate::parse_date_time2</p>

<pre><code>parse_date_time2(tidy_labor$month_year, c("Jan.1990"), exact = TRUE, orders = "bY")
</code></pre>

<p>But the format came out as:</p>

<pre><code>unknown timezone 'Jan.1990'unknown timezone 'Jan.1990'   [1] "1990-01-01 GMT" "1990-01-01 GMT" "1990-01-01 GMT" "1990-01-01 GMT" "1990-02-01 GMT" "1990-02-01 GMT" "1990-02-01 GMT"
</code></pre>

<p>Any help would be much appreciated.</p>
