character string is not in a standard unambiguous format for exchange rate data

Hi,

I am planning to forecast DAX data (German stock exchange index). I have downloaded data from Yahoo Finance. When trying to calculate log-returns of the data with the formula

X.tmp<- read.csv("DAXz2016-2021wegmit0.csv",HEADER=TRUE)
x<- X.tmp$Close
n<- length(x)
xd<-100*diff(log(x))
nd<-n-1
time.nd<- as.Date(X.tmp$Date [1:nd]);

I get the error message character string is not in a standard unambiguous format

I have read several posts related to the error message but none of the answers seems to solve my problem.

Can anyone help me?

If you can post representative data (sufficient to reproduce the problem) it will be more likely to attract answers. See the FAQ: How to do a minimal reproducible example reprex for beginners.

I suspect, in this case, that the problem lies in the argument to as.Date, in which case just the character string of X.tmp$Date is required.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.