Learn R Programming

spdgp (version 0.1.0)

make_wx: Create Spatial Lags of variables

Description

Given a dataframe of numeric values and a spatial weights matrix, calculate the spatial lag of each variable.

Usage

make_wx(x, listw, order = NULL)

Value

A data.frame of the spatially lagged variables.

Arguments

x

a data.frame of independent variables generated with make_x().

listw

a listw object generated with sim_grid_listw().

order

unused.

Examples

Run this code
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