Spatial weights matrix class / constructor
wmat(w, geom, type = NULL, coords = NULL)
w | a matrix |
---|---|
geom | geometry from which the matrix was constructed. Used for plotting. |
type | String describing the weights matrix type |
coords | Alternative coordinates to use when plotting, otherwise will default to centroids. |
#> Spatial weights matrix [15 x 15] #> Type: Contiguity (rook)plot(w)# the vertices default to centroid coordinates; this can be changed by # setting alternative coordinates coords <- st_as_sf(as.data.frame(est_adm1), coords = c("caplong", "caplat"), remove = TRUE, crs = 4326) coords <- st_geometry(coords) w <- set_coords(w, coords) plot(w)