powered by
Given a dataframe of numeric values and a spatial weights matrix, calculate the spatial lag of each variable.
make_wx(x, listw, order = NULL)
A data.frame of the spatially lagged variables.
data.frame
a data.frame of independent variables generated with make_x().
make_x()
a listw object generated with sim_grid_listw().
listw
sim_grid_listw()
unused.
listw <- sim_grid_listw(10, 10) x_vars <- make_x(100, mu = c(0.5, 1.2), var = c(1, 0.5)) res <- make_wx(x_vars, listw) head(res)
Run the code above in your browser using DataLab