Dear All,
There is an example for the priceIts function (the its package) which
does not work for me as expected.
> ?priceIts
> x1 <- priceIts(instrument = c("^ftse"), start =
"1998-01-01",
+ quote = "Close")
Error in validObject(.Object) : invalid class "its" object: Missing
values in dates
> x2 <- priceIts(instrument = c("^gdax"), start =
"1998-01-01",
+ quote = "Close")
Error in download.file(url, destfile, method = method, quiet = quiet) :
cannot open URL
'http://chart.yahoo.com/table.csv?s=^gdax&a=0&b=01&c=1998&d=8&e=28&f=2005&g=d&q=q&y=0&z=^gdax&x=.csv'
In addition: Warning message:
cannot open: HTTP status was '404 Not Found'
> x <- union(x1,x2)
Error: Object "x1" not found
Error in union(x1, x2) : unable to find the argument 'x' in selecting a
method for function 'union'
> names(x) <- c("FTSE","DAX")
> plot(x,lab=TRUE)
Any help appreciated.
Best wishes,
Remigijus
Well I downloaded the data using the link in your message which suggests that the code is right. I don't have its loaded (I assume it's from the irregular time series package) so I can't test the code as you have it. Have you tried checking to see it it is an issue with the internet (your browser, blocked sites etc) rather than a problem in R? Tom> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Remigijus > Lapinskas > Sent: Thursday, 29 September 2005 12:31 PM > To: r-help at stat.math.ethz.ch > Subject: [R] priceIts > > > Dear All, > > There is an example for the priceIts function (the its package) which > does not work for me as expected. > > > ?priceIts > > x1 <- priceIts(instrument = c("^ftse"), start = "1998-01-01", > + quote = "Close") > Error in validObject(.Object) : invalid class "its" object: Missing > values in dates > > x2 <- priceIts(instrument = c("^gdax"), start = "1998-01-01", > + quote = "Close") > Error in download.file(url, destfile, method = method, quiet > = quiet) : > cannot open URL > 'http://chart.yahoo.com/table.csv?s=^gdax&a=0&b=01&c=1998&d=8& > e=28&f=2005&g=d&q=q&y=0&z=^gdax&x=.csv' > In addition: Warning message: > cannot open: HTTP status was '404 Not Found' > > x <- union(x1,x2) > Error: Object "x1" not found > Error in union(x1, x2) : unable to find the argument 'x' in > selecting a > method for function 'union' > > names(x) <- c("FTSE","DAX") > > plot(x,lab=TRUE) > > Any help appreciated. > > Best wishes, > Remigijus > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide!http://www.R-project.org/posting-guide.html
The error message indicates that a problem is occurring in download.file.
Try to use download.file to download some web page from the internet to
see if that works,
download.file("http://www.google.com", destfile =
"google.htm")
If that does NOT work then examine the download.file help page carefully.
You may need to set your proxy server.
If that did work then as a workaround try using get.hist.quote in package
tseries with the argument retclass = "its". Be sure you have the
latest
version of tseries.
On 9/29/05, Remigijus Lapinskas <remigijus.lapinskas at mif.vu.lt>
wrote:> Dear All,
>
> There is an example for the priceIts function (the its package) which
> does not work for me as expected.
>
> > ?priceIts
> > x1 <- priceIts(instrument = c("^ftse"), start =
"1998-01-01",
> + quote = "Close")
> Error in validObject(.Object) : invalid class "its" object:
Missing
> values in dates
> > x2 <- priceIts(instrument = c("^gdax"), start =
"1998-01-01",
> + quote = "Close")
> Error in download.file(url, destfile, method = method, quiet = quiet) :
> cannot open URL
>
'http://chart.yahoo.com/table.csv?s=^gdax&a=0&b=01&c=1998&d=8&e=28&f=2005&g=d&q=q&y=0&z=^gdax&x=.csv'
> In addition: Warning message:
> cannot open: HTTP status was '404 Not Found'
> > x <- union(x1,x2)
> Error: Object "x1" not found
> Error in union(x1, x2) : unable to find the argument 'x' in
selecting a
> method for function 'union'
> > names(x) <- c("FTSE","DAX")
> > plot(x,lab=TRUE)
>
> Any help appreciated.
>
> Best wishes,
> Remigijus
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
>