[R] Problem with get.hist.quote (tseries library)....

Carlos Ortega carlos.ortega at minorplanet.com
Fri Jun 7 09:38:19 CEST 2002


Peter,

Yes, you are correct, the problem is with

dat <- as.POSIXct(strptime(dat, "%d-%b-%y"), tz = "GMT")

I could dig up to that level and check the value of that variable. What is
happening
 at least in my case is that "Apr" is not recognized in my system as a
month's name
but "Abr" (coming from Abril).  So for those quotes I got NAs.

Thanks,
Carlos.

-----Mensaje original-----
De: owner-r-help at stat.math.ethz.ch
[mailto:owner-r-help at stat.math.ethz.ch]En nombre de Peter Dalgaard BSA
Enviado el: viernes, 07 de junio de 2002 0:11
Para: Patrick Hausmann
CC: Peter Dalgaard BSA; r-help at stat.math.ethz.ch
Asunto: Re: [R] Problem with get.hist.quote (tseries library)....


"Patrick Hausmann" <patrick.hausmann at uni-bremen.de> writes:

> At 21:48 - 6 Jun 2002, Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk>
wrote:
>
> > "Patrick Hausmann" <patrick.hausmann at uni-bremen.de> writes:
> >
> > > At 16:36 - 6 Jun 2002, Carlos Ortega wrote:
> > >
> > > > I am having a problem with the get.hist.quote command (tseries
library) in
> > > > the Windows version.
> > >
> > > I am having a similar problem:
> > >
> > > ++++++++++++++ ERROR MESSAGE +++++++++++++++++++
> > > > library(tseries)
> > > > x <- get.hist.quote(instrument = "ibm", quote = c("Cl", "Vol"))
> [...]
>
> > Not happening here.
> >
> > a) is your tseries package up to date?
> First lines from ChangeLog:
> 2002-04-26  Adrian Trapletti <a.trapletti at bluewin.ch>
> 	* DESCRIPTION (Version): New version is 0.9-0.

Same here. (Doesn't it identify itself on load?)

> > b) could you show us a few lines of output from
> >
> >
readLines("http://chart.yahoo.com/table.csv?s=ibm&a=01&b=02&c=1991&d=06&e=05
&f=2002&g=d&q=q&y=0&z=ibm&x=.csv")
> The first two lines:

(...that didn't scoll off the top I assume.)

> [2047] "21-Apr-94,13.60,14.50,13.36,14.44,8758100"
"20-Apr-94,13.17,13.23,12.80,12.92,2207700"
> [2049] "19-Apr-94,13.23,13.30,12.71,13.20,2094000"
"18-Apr-94,13.08,13.39,13.05,13.20,3120000"
> [...]
> The last two lines:
> [2881] "4-Jan-91,27.89,27.95,27.67,27.73,1085100"
"3-Jan-91,27.79,28.16,27.76,27.82,1307400"
> [2883] "2-Jan-91,27.92,28.13,27.73,27.73,1037700"

Same here.

Could you try debug(get.hist.quote) and see what line causes the
error? My bet is this one:

        dat <- as.POSIXct(strptime(dat, "%d-%b-%y"), tz = "GMT")

If so, what is in `dat' at that point?

--
   O__  ---- Peter Dalgaard             Blegdamsvej 3
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._


_____
The information in this email is confidential and it may not be
disclosed or used by anyone other than the addressee. If you are not the
intended recipient, any disclosure, copying, distribution or any action taken or
omitted is prohibited and may be unlawful.
Minorplanet cannot accept responsibility for the accuracy or completeness of
this email as it has been transmitted over a public network. If you suspect
that the email may have been amended, please call the sender.


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list