I have a dataset with 228 observations and, one of the three columns specifying "Date" is in the following form: 2 December 1999 4 November 1999 7 October 1999 ..... My aim is to convert it into this format: 1999-12-02 (yyyy-mm-dd). To do so, I use the "as.POSIXct" function but I get "NA" for all the 228 observations.
I tried this code and any possible variance of that (including some hints got from previous questions similar to mine) such as "as.Date", "strptime", etc.:
new_date <- as.POSIXct(ecb_result1$Date, format = "%Y-%m-%d")
As I said, I expected to see the conversion from "2 December 1999" to "1999-12-02". Instead, I got:
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
Is there anyone who can help me understand what's wrong and how to fix it?