Re: [R] intraday OHLC plot

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon, 24 Mar 2008 07:56:50 -0400

You need zoo 1.5-0 and you are using 1.4-2. Also note that the DF <- line is not needed (though it doesn't hurt either) and was just there to check your similar statement.

On Mon, Mar 24, 2008 at 4:48 AM, Thomas Steiner <finbref.2006_at_gmail.com> wrote:
> Dear all,
>
> thank you very much for continuing to look into this issue!
> I checked the versions and in Gabor's code the spaces and tabs, but
> still the problem remains (see code and error below).
>
> To install quantmod, I used this time Rforge and it did not work. I
> had to install the "Defaults" package from cran first by hand (ie not
> like zoo and xts where it recognizes the dependence). And to get the
> most recent version of the package I had to upgrade R as well (my
> mistake of course). The link mentioned by Jeff points to 0.3.4, but I
> got by the command
> install.packages("quantmod",repos="http://R-Forge.R-project.org") the
> version 0.3.3 as you see below.
>
> > Lines <- '17-03-2008 00:00:001,57641,57661,57471,5750
> + 17-03-2008 00:05:001,57491,57501,57411,5744
> + 17-03-2008 00:10:001,57451,57621,57411,5749'
> > DF <- read.delim2(textConnection(Lines))
> > library(quantmod)
> Lade nötiges Paket: Defaults
> quantmod: Quantitative Financial Modelling Framework
>
> Version 0.3-3
> http://www.quantmod.com
>
> Warning message:
> ungenutzte Verbindung 3 (Lines) geschlossen
> > z <- read.zoo(textConnection(Lines), # replace with "myfile.dat"
> + header = F, sep = "\t", dec = ",",
> + format = "%d-%m-%Y %H:%M:%S", tz = "")
> Fehler in read.zoo(textConnection(Lines), header = F, sep = "\t", dec = ",", :
> index contains NAs
> > q <- as.quantmod.OHLC(z, col.names = c("Open", "High", "Low", "Close"))
> Fehler in ncol(x) : objekt "z" nicht gefunden
> > chartSeries(q)
> Fehler in UseMethod("as.xts") : keine anwendbare Methode für "as.xts"
> >
> > sessionInfo()
> R version 2.6.2 (2008-02-08)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=German_Austria.1252;LC_CTYPE=German_Austria.1252;LC_MONETARY=German_Austria.1252;LC_NUMERIC=C;LC_TIME=German_Austria.1252
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] quantmod_0.3-3 Defaults_1.1-1 xts_0.0-11 zoo_1.4-2
>
> loaded via a namespace (and not attached):
> [1] grid_2.6.2 lattice_0.17-4 tools_2.6.2
> >
>
>
> Anyway, after the upgarde and Jeff's hint to use the chartSeries
> function it works. Now I still have to play around to make the labels
> look nice...
>
> Thanks a lot for all your help,
> Thomas
>



R-help_at_r-project.org 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. Received on Mon 24 Mar 2008 - 12:00:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 24 Mar 2008 - 13:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive