spatial_lag | R Documentation |
Compute the spatial lag for idx-th observation using selected variable and current weights matrix
spatial_lag(gda_w, df)
gda_w |
A Weight object |
df |
A data frame with selected variable only. E.g. guerry["Crm_prs"] |
A data.frame with one column "Spatial Lag"
## Not run:
library(sf)
guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- st_read(guerry_path)
queen_w <- queen_weights(guerry)
crm_lag <- spatial_lag(queen_w, guerry["Crm_prs"])
crm_lag
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.