Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

select.spatial

select points spatially


Description

select a number of points by digitizing the area they fall in

Usage

select.spatial(data, digitize = TRUE, pch = "+", rownames = FALSE)

Arguments

data

data object of class, or extending SpatialPoints; this object knows about its x and y coordinate

digitize

logical; if TRUE, points in a digitized polygon are selected; if FALSE, points identified by mouse clicks are selected

pch

plotting character used for points

rownames

logical; if FALSE, row (coordinate) numbers are returned; if TRUE and data contains a data.frame part, row.names for selected points in the data.frame are returned.

Value

if rownames == FALSE, array with either indexes (row numbers) of points inside the digitized polygon; if rownames == TRUE, character array with corresponding row names in the data.frame part

See Also

Examples

data(meuse)
## the following command requires user interaction: left mouse
## selects points, right mouse ends digitizing
data(meuse)
coordinates(meuse) = c("x", "y")
# select.spatial(meuse)

sp

Classes and Methods for Spatial Data

v1.4-5
GPL (>= 2)
Authors
Edzer Pebesma [aut, cre], Roger Bivand [aut], Barry Rowlingson [ctb], Virgilio Gomez-Rubio [ctb], Robert Hijmans [ctb], Michael Sumner [ctb], Don MacQueen [ctb], Jim Lemon [ctb], Finn Lindgren [ctb], Josh O'Brien [ctb], Joseph O'Rourke [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.