Usage Arguments Details Value Examples
1 | coordinate_nb(foo_spdf, style = "B", dir_out = NULL, ...)
|
foo_spdf |
an object of class |
style |
an optional character representing the style of spatial weights
The same 'style' arg in |
dir_out |
an optional character representing the output directory if the user wishes to write to a '.csv' |
... |
optional arguments passed to |
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
1 2 3 4 5 6 | 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.