Reputation: 14093
Is there an identify
function for pairs
plots?
I.e. a function that from clicking into a pairs
plot returns the row index of the point in the data matrix (data.frame) that corresponds to the point.
I know I can switch to lattice:
splom (matrix (rnorm (30), 10))
trellis.focus ()
panel.link.splom ()
## [1] 7
However, if there exists a base graphics version, I'd like to know it.
Upvotes: 2
Views: 495
Reputation: 212
I don't think there's an equivalent in the base graphics version of pairs
, however, the pairsD3 R package provides an interactive pairs plot that displays the row index of an observation in the tooltip when the mouse hovers over it.
An example with the iris data set:
install.packages("pairsD3")
require("pairsD3")
pairsD3(iris)
More reference here
Upvotes: 1