Learn R Programming

geo (version 1.4-3)

geoidentify: Identifies points on plots using lat and lon coordinates.

Description

Works the same way as identify except that it also accepts coordinates as lat and lon. Identifies points on a plot identified by the user.

Usage

geoidentify(lat, lon = NULL, labels = 1, n = 0, plot = TRUE, atpen = TRUE, offset = 0.5, col = 1, cex = 1)

Arguments

lat,lon
Coordinates of points. The coordinates can be given by two vectors or a data.frame containin vectors lat and lon.
labels
Vector giving labels for each of the points. If supplied, this must have the same length as lat and lon. As a default the vector indece number of the points will be used.
n
Maximum number of points to be identified.
plot
If true, geoidentify plots the labels if the points identified.
atpen
If true, plotted identification is relative to locator position when the point is identified; otherwise, plotting is relative to the identified lat,lon value. This can be useful when points are crowded. Default is true.
offset
Identification is plotted as a text string, moved offset charecter from the point. If the locator was left (right) of the nearest point, the label will be offset to the left (right) of the point.
col
The color of the labels.
cex
Character size expansion of label characters.

Value

Indeces (in lat and lon) corresponding to the identified points.

Side Effects

Labels are placed on the current plot if plot is true.

Details

Observations that have missing values in either lat or lon are treated as if they were not given. When using the X11 driver under the X Window System, a point is identified by positioning the cursor over the point and pressing the left button. To exit identify press the middle button (both buttons on a two button mouse) while the cursor is in the graphics window. The same procedure is used under the suntools driver. This function may also be used with the "tek" drivers.

Some devices that do not allow interaction prompt you for an x,y pair. The nearest point to the locator position is identified, but must be at most 0.5 inches away. In case of ties, the earliest point is identified.

See Also

identify, geolocator, geotext.

Examples

Run this code
## Not run:        geoidentify(stations, labels = stations$temp)
#        # plots the temperature in the closest measuring point.
# 
#        geoidentify(stations, atpen = FALSE)
#        # plots the indece number of the station closest to
#        # where pointed at the stations position.
# ## End(Not run)

Run the code above in your browser using DataLab