I would like to be able to generate a basic splom graph in R, and then use the mouse to click on one of the sub-panels ( panel.pairs in particular) and return R either the coordinates of this sub-panel or, even better, the names of the corresponding variables built in this subpanet.
Here is an example splom to work with:
require(lattice) data(iris) super.sym <- trellis.par.get("superpose.symbol") splom(~iris[1:4], groups = Species, data = iris, panel = panel.superpose, key = list(title = "Three Varieties of Iris", columns = 3, points = list(pch = super.sym$pch[1:3], col = super.sym$col[1:3]), text = list(c("Setosa", "Versicolor", "Virginica"))))
Here I got the closest so far, which allows me to click on a point on one of the sub-panels and observe where this point appears in another place. I really don't want to, but it makes me believe it:
trellis.focus() panel.link.splom() trellis.unfocus() #to close the trellis.focus session
source share