[R-SIG-Finance] Trying to plot intraday data on multiple daily plots
Matti Zemack
matti.zemack at gmail.com
Wed Oct 12 16:42:43 CEST 2011
Hi all again,
Thanks Joshua, you were absolutely correct in the error you spotted.
I fixed it by inserting;
date<-toString(datte)
before the chart_Series instruction. (See in edit to my original post below)
But I still couldn't get the plotting from chart_Series to work within the loop.
I was using chart_Series (still in alpha?) because I needed the par(mfrow=c(5,5)) which is not available in chartSeries.
And the chart_Series gave me problems with the graphing not working in the loop…
Anyway, I decided to go the pdf-route. I instead use chartSeries with output to a pdf which is stable. And printed the pdf with 16 pages on one page. This is a perfectly working workaround waiting for a stable chart_Series.
Thanks to all package developers, all time you spent on the packages has made life much easier for me.
Regards,
Matti Zemack
-----
Matti Zemack, Broadcast Technology, Stockholm, Sweden
matti.zemack at gmail.com
On 12 okt 2011, at 05:05, Joshua Ulrich wrote:
> Your example isn't reproducible and I don't have example data at hand,
> so here's my guess: "datte" is a Date class object, but (according to
> ?chart_Series) the subset argument of chart_Series is supposed to be a
> character string.
> --
> Joshua Ulrich | FOSS Trading: www.fosstrading.com
>
>
>
> On Tue, Oct 11, 2011 at 12:47 PM, Matti Zemack <matti.zemack at gmail.com> wrote:
>> #Now trying to loop per date instead as I understand ONE chart_Series command must be sent for every plot.
>> #Excuse me for my (probably) ugly way of retrieving the dates for the loop, but I'm new to R….
>> par(mfrow=c(4,4))
>> mzGSPCdaily<-to.daily(mzGSPC5)
>> for (i in 1:length(mzGSPCdaily[,1])) {
>> datte<-as.Date(time(mzGSPCdaily[i]))
>> #Below print is just for verifying that I receive dates
datteStr<-toString(datte)
>> print(datteStr) #This works and prints the dates "2011-08-01", "2011-08-02"...
>> chart_Series(mzGSPC5, subset=datteStr)
>> }
More information about the R-SIG-Finance
mailing list