nearPoints with Lattice

Currently have the nearPoints argument in my app which displays results on screen, but it displays the wrong data. The plot generated is a bivariate xyplot() from lattice and when I click inside the plot, the nearPoints output table produces visible output to screen, but it does not align with the coordinates displayed on the xyplot.

I have scoured stackoverflow and have also read the documentation and in both cases I see that scaling is not supported for lattice objects, but is supported with base or ggplot2 objects.

My entire app makes use of lattice style plots and I'd hate to rewrite my entire program to change the plots just to get nearPoints to work as it should.

Has anyone found a solution so that the scaling can work with lattice as it does with base or ggplot2?

I just noticed this today. I've made a note of it on GitHub -- https://github.com/rstudio/shiny/issues/2422

My first impression is that this was never implemented because it's a hard problem, but if there is enough interest, it might be worth looking into again

1 Like