title: How to extract month from a column in R
body: <p>I am trying to create a column which returns the month of a given observation.</p>
  <p>My dataframe is called:&quot; FF5_Class&quot;</p>
  <p>I tried to run the following code:</p>
  <p>FF5_class$Month &lt;- FF5_class %&gt;%
  month(date)</p>
  <p>However, i received the following error message:&quot;</p>
  <p>&quot;Error in as.POSIXlt.default(x, tz = tz(x)) :
  do not know how to convert 'x' to class “POSIXlt”</p>
  <p>A snip from my data is like this:</p>
  <pre><code>date    Month
  2000-01 
  2000-02 
  2000-03 
  2000-04 
  2000-05 
  2000-06 
  2000-07 
  2000-08 
  2000-09 
  2000-10 
  2000-11 
  2000-12 
  2001-01 
  2001-02 
  2001-03 
  2001-04 
  2001-05 
  2001-06 
  2001-07 
  2001-08 
  2001-09 
  2001-10 
  2001-11 
  2001-12 
  </code></pre>
  <p>How can I do this? Thank you very much.</p>