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

edit.nb

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 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 edit.

This method relies on direct contact with the graphics device. Do not use in RStudio.

Usage

## S3 method for class 'nb'
edit(name, coords, polys=NULL, ..., use_region.id=FALSE)

Arguments

name

an object of class nb

coords

matrix of region point coordinates; if missing and polys= inherits from SpatialPolygons, the label points of that object are used

polys

if polygon boundaries supplied, will be used as background; must inherit from SpatialPolygons

...

further arguments passed to or from other methods

use_region.id

default FALSE, in identify use 1-based observation numbers, otherwise use the nb region.id attribute values

Value

The function returns an object of class nb with the edited list of integer vectors containing neighbour region number ids, with added attributes tallying the added and deleted links.

Author(s)

Roger Bivand Roger.Bivand@nhh.no

See Also

Examples

## Not run: 
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
class(columbus)
if (FALSE) nnb1 <- edit.nb(col.gal.nb, polys=as(columbus, "Spatial"))

## End(Not run)

spdep

Spatial Dependence: Weighting Schemes, Statistics

v1.1-11
GPL (>= 2)
Authors
Roger Bivand [cre, aut] (<https://orcid.org/0000-0003-2392-6140>), Micah Altman [ctb], Luc Anselin [ctb], Renato Assunção [ctb], Olaf Berke [ctb], Andrew Bernat [ctb], Guillaume Blanchet [ctb], Eric Blankmeyer [ctb], Marilia Carvalho [ctb], Bjarke Christensen [ctb], Yongwan Chun [ctb], Carsten Dormann [ctb], Stéphane Dray [ctb], Virgilio Gómez-Rubio [ctb], Martin Gubri [ctb], Rein Halbersma [ctb], Elias Krainski [ctb], Pierre Legendre [ctb], Nicholas Lewin-Koh [ctb], Angela Li [ctb], Hongfei Li [ctb], Jielai Ma [ctb], Abhirup Mallik [ctb, trl], Giovanni Millo [ctb], Werner Mueller [ctb], Hisaji Ono [ctb], Pedro Peres-Neto [ctb], Gianfranco Piras [ctb], Markus Reder [ctb], Jeff Sauer [ctb], Michael Tiefelsdorf [ctb], René Westerholt [ctb], Levi Wolf [ctb], Danlin Yu [ctb]
Initial release
2021-09-07

We don't support your browser anymore

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