identify.Map {TeachingDemos} | R Documentation |
This function allows you to click in a polygon in a map plotted using the maptools package and labels the polygon.
identify.Map(x, labels = as.character(Map$att.data$NAME), n = Inf, ...) identify.polylist(...)
x |
The map object plotted using plot.Map . |
labels |
Vector of labels used to label the polygons. |
n |
Maximum number of polygons to label. |
... |
Additional arguments passed to identify.Map or text . |
The function identify.polylist
is just a wrapper function for
identify.Map
which handles both types of data.
The point you click on is checked against every polygon in the map, so this function may be slow on very complicated maps.
Right click on the map to stop before n
.
A vector of integers corresponding to the polygons clicked on.
These functions are beta level at best and will probably soon be
seperceeded by functions in maptools
, sp
, or
spproj
. The plot.Map function has been depricated so use
plot.polylist instead (convert Map objects to polylist objects before
plotting), identify.Map works on polylist objects as well.
Greg Snow greg.snow@intermountainmail.org
plot.Map
in the maptools
package, identify
## Not run: library(maptools) plot(state.vbm) identify(state.vbm) # now click on the map a few times. plot(state.vbm) identify(state.vbm, state.abb, n=5) ## End(Not run)