0

I have a csv file where the first column consists of dates written as 199010 (October 1990).

I have to convert it to the class 'date'. I tried the following:

library(lubridate)

library(xts)

data<-read.csv("risk_free_return_monthly.csv")

dates<-data$date

data1<-as.Date(dates,format= "%Y%m")

Whenever I try to print data1 I get a list that only consits of NA

Panagiotis Kanavos
  • 120,703
  • 13
  • 188
  • 236

0 Answers0