0

I have a dataset in a .csv for Pacific Decadal Oscillation (PDO) that has the date in the format yyyymm. For example January of 1980 would be 198001. How would I go about getting r to read this.

I have tried

PDO$date1<-as.POSIXct(PDO$Date, format= "%Y%m")

and

as.Date(as.character(PDO$Date), format='%Y%m')

With as.POSIXct it says that orign must be supplied and with as.Date it returns NA.

Thanks for the help.

0 Answers0