Hi guys, I need some help,
I am a complete Newbie to R, actually learning it to run my research project
I downloaded MOEX.csv dataset from Investing SA, and R translated it into a Tibble, which i converted to a data.frame,
here is a summary code
moex.data <- read_excel("MOEX.xlsx", n_max=4816)
moex.data <- as.data.frame(moex.data)
now to convert the date variable which is in the format "Dec 30, 2016" has been a challenge as i have tried all conversion methods I know to no avail.
When I try to run the code
ts.moex.data <- xts(moex.data[,2:5], order.by = moex.data[,1])
I get the following error message
Error in xts(alt.moex.data[, 2:5], order.by = alt.moex.data[, 1]) :
order.by requires an appropriate time-based object
This is so interesting because between the time of posting my topic and getting back to this page,..i found the solution,...it was so simple,..i think i need much reading in R.
Thanks for the instant response,
I will take note of providing a reproducible example, whenever i make a post in the future
For a univariate time series, the first recourse should be to take a vector, which I'll call V as an argument to ts with an argument for starting date and an argument for frequency. Passing a vector of dates is not needed.