On Tue, Mar 7, 2017 at 2:52 AM, Allan Tanaka <[hidden email]> wrote:
> HiSo I tried running the p but i'm stuck as i get the following error:
> In download.file(url, destfile, method = method, quiet = quiet) : cannot open URL 'http://chart.yahoo.com/table.csv?s=DJI&a=2&b=13&c=2012&d=2&e=07&f=2017&g=d&q=q&y=0&z=DJI&x=.csv': HTTP status was '404 Not Found'
> Here is the R code:
> library(vars)library(tawny)library(quantmod)library(MASS)library(stats)library(DEoptim)library(sn)library(SkewHyperbolic)library(tseries)symbols<-getSymbols(c("^GSPC", "^DJI"))endDate <- Sys.Date()startDate <- endDate - as.difftime(52*5, unit="weeks")quoteType <- "Close"p <- do.call(cbind, lapply(symbols, get.hist.quote, start=startDate, end=endDate, quote=quoteType))
Please try to post *minimal* reproducible examples. Only two packages
are needed to run your code.
Your calls with get.hist.quote() are not what you expect. Note that
the tickers you passed to getSymbols() are "^GSPC" and "^DJI". But
those are not the objects that getSymbols() creates (or the adjusted
ticker symbols it returns), because they are not syntatically valid R
names (because they start with a circumflex).
So you call get.hist.quote() with tickers "GSPC" and "DJI", which are
not the S&P 500 and Dow Jones Industrial indexes, respectively. The
GSPC data is not what you expect, and there's no data for DJI.
> [[alternative HTML version deleted]]
Please follow the posting guide and do not post HTML. The list server
does not like it and can mangle your message, as it did in this case.