I am having some trouble in creating a xyplot of a zoo object.
I have created a simplified example:
z <- zoo(cbind(a=1:4,b=11:14,c=10:13,d=5:8,e=10:7,f=1:4), 1991:1994)
I am using the following code to create a multipanel xyplot:
numLbl <- 4
xx <- seq(from = min(time(z)), to = max(time(z)), length.out = numLbl)
xyplot(z[,c(1,2,4,6)],scales = list(x = list(at = time (z), rot = 90)), layout = c(1,4), aspect = "fill", xlab = "",
panel = function (x,y, ...) {
panel.abline (v = xx, col = "grey", lty = 3)
panel.xyplot(x, y, type = "b", col = 1)
})
What I would like to do is the reverse the y-axis on only one of this panels. I have found a related example:
However I cannot get the prepanel to work with my example. I am quite new to lattice, and there is probably something with the panel function I do not understand.
In addition if there is an easy way to get one of the panels as histograms and the others as lines I would be very grateful for tips.
Any help is very much appreciated!