I'm using the quantmod::getsymbols
function to retreive the stock index data for yahoo finance (as showed in the picture, it's called GDAXI.xts
)
Now I want to access the date to the left, but this column isn't in the GDAXI file. How can I access the date? I tried different ways and couldn't figure it out, last time it worked when I tried d1.ts=GDAX[,0]
, but that's not working here.
Can anybody tell me why? Thank you very much in advance.
Datum=as.Date(GDAXI[,0])
Error in as.Date.default(GDAXI[, 0]) :
do not know how to convert 'GDAXI[, 0]' to class “Date”
Datum=GDAXI[,0]
View(Datum)
Warning in View :
'row.names' is not a character vector of length 0 -- omitting it. Will be an error!
Warning in View :
'row.names' is not a character vector of length 0 -- omitting it. Will be an error!
Warning message:
In as.data.frame.numeric(coredata(x), row.names, optional, ...) :
'row.names' is not a character vector of length 0 -- omitting it. Will be an error!
Datum=as.date(GDAXI[,0])
Error: could not find function "as.date"
In addition: Warning messages:
1: In as.data.frame.numeric(coredata(x), row.names, optional, ...) :
'row.names' is not a character vector of length 0 -- omitting it. Will be an error!
2: In as.data.frame.numeric(coredata(x), row.names, optional, ...) :
'row.names' is not a character vector of length 0 -- omitting it. Will be an error!
3: In as.data.frame.numeric(coredata(x), row.names, optional, ...) :
'row.names' is not a character vector of length 0 -- omitting it. Will be an error!
Da.ts=GDAXI[,0]