I called index data from an excel csv. (Dates are in yyyy/mm/dd format.)
library(tseries)
library(minpack.lm)
library(ggplot2)
index <- read.csv("C:\\Users\\Toshiba\\Desktop\\deks\\DATA.csv")
ts <- index
df <- data.frame(ts)
df <- data.frame(ts)
df <- data.frame(Date=as.Date(rownames(df)),Y=df$Close)
I received the error:
Error in charToDate(x) : character string is not in a standard unambiguous format
and for
df$days<-as.numeric(df$Date-df[1,]$Date)
I received
Warning message: In Ops.factor(df$Date, df[1, ]$Date) : - not meaningful for factors
I set the data as X=DATE(YYYY/MM/DD)
and Y=INDEX VALUE
.
I changed the date to [(DD/MM/YYYY),(DD-MM-YYYY),(YYYY-MM-DD)] and still the error appears. How can I proceed?