I am trying to create a column which returns the month of a given observation.
My dataframe is called:" FF5_Class"
I tried to run the following code:
FF5_class$Month <- FF5_class %>% month(date)
However, i received the following error message:"
"Error in as.POSIXlt.default(x, tz = tz(x)) : do not know how to convert 'x' to class “POSIXlt”
A snip from my data is like this:
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
How can I do this? Thank you very much.