« Return to Thread: two zoo questions

two zoo questions

by michal miklovic :: Rate this Message:

Reply to Author | View in Thread

Hi,

I have a zoo object with three time series and the corresponding dates. When I plot it, the x-axis contains dates which are not in the object and, naturally, no data points are displayed for these dates. For example, the date "2006-05-20" is not in the object, but it appears in the x-axis of the plot. As a result, I get a plot with 'empty' segments. The object, my code and sessionInfo are copied below.
I would like to ask if it is possible to plot only the relevant dates, i.e. to produce a plot without, e.g., the date "2006-05-20". If yes, how could I do it?

My second question concerns the way of displaying the dates on the x-axis. Currently, the dates are displayed as "V 22", which stands for "2006-05-22". I would like them to be displayed as "22 05 2006" or "22 May 2006". How can I do this?

Thanks for your help!

Michal


The zoo object, ShorterSpan:
            PXreturns VaRWHSe099 VaRWHSe095
2006-05-19 -0.6479279   1.878092   1.515232
2006-05-22 -6.1249511   1.878092   1.515232
2006-05-23  2.3501118   1.878092   1.515232
2006-05-24 -4.2859466   2.350112   2.350112
2006-05-25  2.6466856   2.350112   2.350112
2006-05-26  2.5496719   2.646686   2.646686
2006-05-29 -0.7580990   2.646686   2.646686
2006-05-30 -1.9170851   2.646686   2.646686
2006-05-31 -1.8566689   2.646686   2.646686
2006-06-01  1.4198415   2.646686   2.646686
2006-06-02  1.6703232   2.646686   2.646686
2006-06-05 -0.4974407   2.646686   2.646686
2006-06-06 -1.6936396   2.646686   2.646686
2006-06-07 -3.0212406   2.646686   2.646686
2006-06-08 -4.0235989   2.646686   2.646686
2006-06-09 -1.3131054   2.646686   2.646686
2006-06-12 -2.4710858   2.646686   2.646686
2006-06-13 -3.0808024   2.646686   2.646686
2006-06-14  1.9859772   2.646686   2.646686
2006-06-15  7.0481958   2.646686   2.646686
2006-06-16  0.1095805   7.048196   7.048196
2006-06-19  2.4037947   3.583430   7.048196

My code:

plot(ShorterSpan, plot.type = "single", type = "p", xlab = "Date", ylab = "",
    col = list("black", "red", "orange"), pch = c(19,22,23), las = 1)
legend.text <- expression(paste("% log returns on PX"),
    paste("VaR WHS, ", eta, " = 0.99"), paste("VaR WHS, ", eta, " = 0.95"))
legend("topleft", legend.text, col=c("black", "red","orange"), pch = c(19,22,23),
    bty="n", y.intersp = 1.5)


sessionInfo()

R version 2.6.2 (2008-02-08)
i386-pc-mingw32

locale:
LC_COLLATE=Slovak_Slovakia.1250;LC_CTYPE=Slovak_Slovakia.1250;LC_MONETARY=Slovak_Slovakia.1250;
LC_NUMERIC=C;LC_TIME=Slovak_Slovakia.1250

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

other attached packages:
[1] zoo_1.5-2

loaded via a namespace (and not attached):
[1] grid_2.6.2     lattice_0.17-6



      ____________________________________________________________________________________

[[elided Yahoo spam]]
        [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance@... mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.

 « Return to Thread: two zoo questions