coordinate_nb
: The coordinate_nb() function returns spatial neighborhoods in a coordinate triplet formatcoordinate_nb(foo_spdf, style = "B", dir_out = NULL, ...)
Argument |Description
------------- |----------------
foo_spdf
| an object of class SpatialPolygonsDataFrame
style
| an optional character representing the style of spatial weights The same 'style' arg in nb2listw
dir_out
| an optional character representing the output directory if the user wishes to write to a '.csv'
...
| optional arguments passed to nb2listw
If dir_out=NULL (the default), then a data.frame of (i,j,k) coordinate triplets is returned to the environment.
See listw2sn
for more details.
Otherwise a '.csv.' will be created at the specified destination path.
A data.frame of the nb-coordinate triplets ("from","to","weights") with 'spatial.neighbour' class returned from listw2sn
```r example(columbus,package="spdep") out_ijk = coordinate_nb(foo_spdf=columbus, zero.policy=TRUE)
# above output is in coordinate structure # below converts to adjacency matrix mat_adj = spdep::as.spam.listw(sn2listw(out_ijk)) ```
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.