Okay, so here's a sample of what I have in a data frame
months other_column1 other_column2 ...
01-1912 ... ...
02-1912 ... ...
03-1912 ... ...
...
Now, I'm trying to convert the column "months" to be the index of the time series, so this is what I'm doing at the moment to try and make it a Date object:
dates <- as.Date(df$months, format="%m-%Y")
This goes through with no error messages, but all I get is a vector full of NA instead of the dates. Any ideas? Do you need more information, don't know what to tell more really?
New to R, seems to be quite powerful, so I'm trying to learn some. Thanks.