-
Notifications
You must be signed in to change notification settings - Fork 26
/
edit.nb.Rd
39 lines (35 loc) · 1.71 KB
/
edit.nb.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
% Copyright 2001-2010 by Roger S. Bivand
\name{edit.nb}
\alias{edit.nb}
\title{Interactive editing of neighbours lists}
\description{
The function provides simple interactive editing of neighbours lists to
allow unneeded links to be deleted, and missing links to be inserted. It uses \code{identify} to pick the
endpoints of the link to be deleted or added, and asks for confirmation before
committing. If the result is not assigned to a new object, the editing
will be lost - as in \code{edit}.
This method relies on direct contact with the graphics device. Do not use in RStudio.
}
\usage{
\method{edit}{nb}(name, coords, polys=NULL, ..., use_region.id=FALSE)
}
\arguments{
\item{name}{an object of class \code{nb}}
\item{coords}{matrix of region point coordinates; if missing and polys= inherits from \code{SpatialPolygons}, the label points of that object are used}
\item{polys}{if polygon boundaries supplied, will be used as background; must inherit from \code{SpatialPolygons}}
\item{...}{further arguments passed to or from other methods}
\item{use_region.id}{default \code{FALSE}, in \code{identify} use 1-based observation numbers, otherwise use the \code{nb} \code{region.id} attribute values}
}
\value{
The function returns an object of class \code{nb} with the edited list of integer vectors containing neighbour region number ids, with added attributes tallying the added and deleted links.
}
\author{Roger Bivand \email{Roger.Bivand@nhh.no}}
\seealso{\code{\link{summary.nb}}, \code{\link{plot.nb}}}
\examples{
\dontrun{
columbus <- st_read(system.file("shapes/columbus.gpkg", package="spData")[1], quiet=TRUE)
class(columbus)
if (FALSE) nnb1 <- edit.nb(col.gal.nb, polys=as(columbus, "Spatial"))
}
}
\keyword{spatial}