This is useful for visually exploring R spatial data such as
SpatialGridDataFrames. By clicking on various
features, the value at that point will be displayed.
library(rgdal) y = readGDAL(system.file("pictures/Rlogo.jpg", package="rgdal"), band=1) y.grid = y@grid y.coords = coordinates(y.grid) image(y) identify(x=y.coords, y=NULL, n=1)
y refer to coordinates (in this case because
y can be set to
n is the
number of features to identify.