I'm trying to convert a data.frame object originating from a .csv to an xts object. Instead of correctly converting to an xts object, it gives the error:
Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format
I've tries to change the Date column to the class Date, to no avail. Here is the code:
library(xts)
mydata <- read.csv("https://sites.google.com/site/jonspinney/home/mba-6693-2017/edhec.csv?attredirects=0&d=1",header=TRUE,sep=",")
mydata$Date <- as.POSIXlt(mydata$Date, format = "%m/%d/%Y")
mydata <- as.xts(mydata)
class(mydata$Date)
class(mydata)