Skip to content

Problem with get.hist.quote() in tseries

2 messages · Ajay Shah, Gabor Grothendieck

#
When using get.hist.quote(), I find the dates are broken. This is with
R 2.1.1 on Mac OS X `panther'.
Loading required package: quadprog

    'tseries' version: 0.9-27

    'tseries' is a package for time series analysis and computational
    finance.

    See 'library(help="tseries")' for details.
trying URL 'http://chart.yahoo.com/table.csv?s=^VIX&a=0&b=02&c=1991&d=7&e=18&f=2005&g=d&q=q&y=0&z=^VIX&x=.csv'
Content type 'text/csv' length unknown
opened URL
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........

downloaded 150Kb
[1] 26.62 27.93 27.19    NA    NA 28.95
Open  High   Low Close
 [1,] 26.62 26.62 26.62 26.62
 [2,] 27.93 27.93 27.93 27.93
 [3,] 27.19 27.19 27.19 27.19
 [4,]    NA    NA    NA    NA
 [5,]    NA    NA    NA    NA
 [6,] 28.95 28.95 28.95 28.95
 [7,] 30.38 30.38 30.38 30.38
 [8,] 33.30 33.30 33.30 33.30
 [9,] 31.33 31.33 31.33 31.33
[10,] 32.63 32.63 32.63 32.63
(dates don't show).
mts [1:5343, 1:4] 26.6 27.9 27.2   NA   NA ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr [1:4] "Open" "High" "Low" "Close"
 - attr(*, "tsp")= num [1:3] 33240 38582     1
 - attr(*, "class")= chr [1:2] "mts" "ts"

I wonder what I'm doing wrong.
#
There is no head.ts and x[1:10,] has the side effect of converting
it from class ts to class matrix.   Use window 

  window(x, end = start(x)[1]+10)

instead or use 

  head(as.zoo(x)) 

since there is a head.zoo in the 'zoo' package.
On 8/19/05, Ajay Narottam Shah <ajayshah at mayin.org> wrote: