I'd like to be able to generate a basic splom
plot in R and then use my mouse to click on one of the sub-panels (panel.pairs
, specifically) and have R return either the coordinates of that sub-panel, or even better, the names of the corresponding variables plotted in that sub-panel.
Here's 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's the closest I've gotten so far, which lets me click on a point in one of the sub-panels, and observe where that point appears elsewhere. Not actually what I want, but it leads me to believe it's possible:
trellis.focus()
panel.link.splom()
trellis.unfocus() #to close the trellis.focus session