[R] priceIts and yahoo
Dear R People: About 2 years ago, there were a few messages about the function priceIts from library(its) generating error messages. One of the suggested fixes at that time was to check security software and such. I'm getting the same message tonight, and have checked both from Windows and a Linux installation. The other suggestion was to determine if there is still a problem with the yahoo Finance website. This may still be the problem. Does anyone have any other suggestions, please? Thanks in advance! Sincerely, Erin Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: [EMAIL PROTECTED] __ R-help@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 and provide commented, minimal, self-contained, reproducible code.
Re: [R] priceIts
Prof Brian Ripley stats.ox.ac.uk> writes: > chart.yahoo.com is notoriously fickle (as we have seen from the tseries Maybe we should update the base URL. I maintain CPAN's Finance::YahooQuote (and am author of two apps, also on CPAN, which use it fairly heavily) and this has been nothing but rock solid in the six years that I've been scraping data from Yahoo, often at a once-a-minute frequency (for the smtm quote display tool). Of note is that Finance::YahooQuote uses a different machine: $QURLbase = "http://quote.yahoo.com/d?f=";; but both chart.yahoo.com and quote.yahoo.com appear to be on the same subnet. Not sure I'll have time to patch tseries, but it is something we may need to keep in mind. Hth, Dirk __ R-help@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
Re: [R] priceIts
On Thu, 29 Sep 2005, Mulholland, Tom wrote: > 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) The package is called its, as the message correctly said. > so I can't test the code as you have it. chart.yahoo.com is notoriously fickle (as we have seen from the tseries example using it). Note that the first command (which gave me no error) also downloaded from there, so this is not going to be an access issue. I do get a 404 error on that URL (from two separate ISPs), but not if gdax is twice replaced by ftse. I do think the posting guide makes clear this is an issue for the package maintainer, not for R-help. > > 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: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] Behalf Of Remigijus >> Lapinskas >> Sent: Thursday, 29 September 2005 12:31 PM >> To: r-help@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@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 > > __ > R-help@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 > -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@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
Re: [R] priceIts
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 <[EMAIL PROTECTED]> 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@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 > __ R-help@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
Re: [R] priceIts
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: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Remigijus > Lapinskas > Sent: Thursday, 29 September 2005 12:31 PM > To: r-help@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@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 __ R-help@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
[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@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
Re: [R] priceIts problem
On Thu, 2004-07-01 at 19:26, Marc Schwartz wrote: > On Thu, 2004-07-01 at 19:02, Erin Hodgess wrote: > > Dear R People: > > > > In library(its), there is a command priceIts. > > > > There is a problem with this command. It is returning an error message: > > > > > ibm1 <- priceIts(instrument="ibm",start="1998-01-01",quote="Open") > > Error in download.file(url, destfile, method = method, quiet = quiet) : > > cannot open URL > > `http://chart.yahoo.com/table.csv?s=ibm&a=0&b=01&c=1998&d=5&e=30&f=2004&g=d&q=q&y=0&z=ibm&x=.csv' > > In addition: Warning message: > > cannot open: HTTP status was `404 Not Found' > > > > > > > > > This has been working fine until tonight. > > > > Has anyone else seen this, please? > > thanks in advance! snip > I have copied Heywood Giles on this reply as an FYI and for > confirmation. Apologies. That should be Giles Heywood. Marc __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] priceIts problem
On Thu, 2004-07-01 at 19:02, Erin Hodgess wrote: > Dear R People: > > In library(its), there is a command priceIts. > > There is a problem with this command. It is returning an error message: > > > ibm1 <- priceIts(instrument="ibm",start="1998-01-01",quote="Open") > Error in download.file(url, destfile, method = method, quiet = quiet) : > cannot open URL > `http://chart.yahoo.com/table.csv?s=ibm&a=0&b=01&c=1998&d=5&e=30&f=2004&g=d&q=q&y=0&z=ibm&x=.csv' > In addition: Warning message: > cannot open: HTTP status was `404 Not Found' > > > > > This has been working fine until tonight. > > Has anyone else seen this, please? > thanks in advance! It would appear that the URL at Yahoo has changed. If you try your URL in a browser, you get the same 404 msg. Going to the page for securing an IBM quote: http://finance.yahoo.com/q/hp?s=IBM&a=00&b=1&c=1998&d=05&e=30&f=2004&g=d The URL towards the bottom of the page for the CSV download is: http://ichart.yahoo.com/table.csv?s=IBM&a=00&b=1&c=1998&d=05&e=30&f=2004&g=d&ignore=.csv Note the 'ichart' as opposed to 'chart' in your error msg above. A quick review of the R source in the 'its' package suggests that the base URL for Yahoo is hard coded in the priceIts() function and the 'provider' argument is not yet used. I have copied Heywood Giles on this reply as an FYI and for confirmation. A short term workaround would be to edit the function's code using fix(priceIts) and change the base URL in the function body as indicated above. That seems to work for me with a quick check. HTH, Marc Schwartz __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] priceIts problem
Dear R People: In library(its), there is a command priceIts. There is a problem with this command. It is returning an error message: > ibm1 <- priceIts(instrument="ibm",start="1998-01-01",quote="Open") Error in download.file(url, destfile, method = method, quiet = quiet) : cannot open URL `http://chart.yahoo.com/table.csv?s=ibm&a=0&b=01&c=1998&d=5&e=30&f=2004&g=d&q=q&y=0&z=ibm&x=.csv' In addition: Warning message: cannot open: HTTP status was `404 Not Found' > This has been working fine until tonight. Has anyone else seen this, please? thanks in advance! Sincerely, Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html