Skip to content

Help xyplot

4 messages · Peter Maclean, Nicole Ford, Duncan Mackay

#
Hi Peter

Try the 2 examples below - it may give you some ideas

useOuterStrips(strip      = 
strip.custom(factor.levels = paste("Year", c(2010:2012)),
                                          par.strip.text = list(cex = 0.75)),
                strip.left = 
strip.custom(factor.levels = paste("Lat.", 
rep(c(3,2) ,each = 2), "? S, Long.", rep(5:4, 2), "? W"),
                                          par.strip.text = list(cex = 0.75)),
xyplot(prec~month|year*paste(lat,lon), data=ndata,
        as.table = T,
        scales   = list(x = list(alternating = FALSE,
                                 relation    = "same",
                                 rot         = 60),
                        y = list(alternating = FALSE,
                                 relation    = "same",
                                 rot         = 0)
                    ),
        ylim=c(min, max),
        type     = c("b"),
        col      = 1
)  # xyplot **
) ## useOuterStrips

useOuterStrips(strip      = 
strip.custom(factor.levels = paste("Year", c(2010:2012)),
                                          par.strip.text = list(cex = 0.75)),
                strip.left = FALSE,
xyplot(prec~month|year*paste(lat,lon), data=ndata,
        as.table = T,

        scales   = list(x = list(alternating = FALSE,
                                 relation    = "same",
                                 rot         = 60),
                        y = list(alternating = FALSE,
                                 relation    = "same",
                                 rot         = 0)
                    ),
        ylim=c(min, max),
        col      = 1,
        panel    = function(x,y ,...){

                     pnl = panel.number()

                     if (pnl %in% c(1:6)) 
panel.xyplot(x,y, type = "b",...) else panel.xyplot(x,y, type = "l",...)

                     grid.text(label = 
paste("Lat.", rep(c(3,2) ,each = 6)[pnl], "? S, 
Long.", rep(rep(5:4, 3),2)[pnl], "? W"),
                               x = unit(.1, "npc"),
                               y = unit(.8, "npc"),
                               hjust = NULL, vjust = NULL, rot = 0,
                               just = "left", default.units = "npc",
                               gp = gpar(cex = 0.8) )


                   }
)  # xyplot **
)

If you want to have selected? points aggregate first
For sampling you would have to sample that first 
and then use abs()[5] to get the five nearest

Not sure what you mean exactly and without a 
sample of the 5000 cannot help further

HTH

Regards

Duncan

Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: mackay at northnet.com.au
At 09:15 23/02/2013, you wrote: