title: How Do I Mass Replace Abbreviated Months Into Full Month Names And Create A Function To Do It Over Multiple Columns
body: <p>So I have an excel sheet loaded into R with multiple dates. I need to convert everything into an actual date that can be read in R but the way the sheet came to me (I didn't make it), all the dates are messed and not readable by defaults. I also tried just fixing it in excel by changing the setting from &quot;Text&quot; to &quot;Long Date&quot; but didn't help change anything in R.</p>
  <p>So far I have been able to separate one date column into three columns using the <code>separate()</code> function twice (once for the year and twice in a nested way for the month and day). The day and year columns are now set to an <code>as.numeric()</code>. Now all I have to do convert the screwed up months into something actually readable in R that can let me do a full date conversion.</p>
  <p>I want to turn this into this:</p>
  <pre><code>Month Date        Readable Month
    Jan                  January
    Feb                  February
    Mar                  March
     .                     .
     .                     .
    July                 July
    June                 June
  </code></pre>
  <p>They're all <code>chr</code> in my dataframe. And there are a lot of columns I need to fix with this.</p>
  <p>Once I can get this last step figured out, I'm planning on creating a function to automatically go through the process and create a new &quot;date&quot; column with dates that are readable in R. The &quot;Full_Date&quot; Column where I need to get to but have not gotten yet.</p>
  <pre><code>   Month      Day      Year             Full_Date
    January      1      1999             1999-01-01
    March       21      2019             2019-03-21
  
  </code></pre>
  <p>my code--though probably not the most efficient:</p>
  <pre><code>birth_data &lt;- data.frame(
    Brirth_Month = separate(
      separate(play_data, col = &quot;Birth&quot;, into = c(&quot;B_M_D&quot;, &quot;B_Year&quot;), sep = &quot;\\,&quot;),
      col = &quot;B_M_D&quot;,
      into = c(&quot;B_Month&quot;, &quot;B_Day&quot;),
      sep = &quot; &quot;)$B_Month,
    Brirth_Day = as.numeric(separate(
      separate(play_data, col = &quot;Birth&quot;, into = c(&quot;B_M_D&quot;, &quot;B_Year&quot;), sep = &quot;\\,&quot;),
      col = &quot;B_M_D&quot;,
      into = c(&quot;B_Month&quot;, &quot;B_Day&quot;),
      sep = &quot; &quot;)$B_Day),
    Birth_Year = as.numeric(separate(play_data, col = &quot;Birth&quot;, into = c(&quot;B_M_D&quot;, &quot;B_Year&quot;), sep = &quot;\\,&quot;)$B_Year)
  )
  
  birth_data
  </code></pre>
  <p><strong>edit</strong>
  original data example I made but not real date, just randomly made by me</p>
  <pre><code>play_data &lt;- data.frame(
    Birth = c(&quot;Jan 23, 2019&quot;, &quot;Feb 23, 1998&quot;, &quot;June 3, 2003&quot;, &quot;Oct 7, 2007&quot;, &quot;Feb 28, 2004&quot;, &quot;Apr 19, 2014&quot;, &quot;Mar 11, 1988&quot;, &quot;Sept 30, 2011&quot;)
  )
  
  
  str(playdate)
  as.Date(dates$Birth)
  </code></pre>