## Generate a 5 x 5 grid of nodes separated by 1000m.
nodes <- expand.grid(
x = seq(from = 0, to = 4000, by = 1000),
y = seq(from = 0, to = 4000, by = 1000)
)
## Create local data with one parameter per node.
ldata <- matrix(0.1, nrow = 1, ncol = nrow(nodes))
## Add spatial coupling with a 2500m cutoff.
ldata_augmented <- add_spatial_coupling_to_ldata(
x = nodes$x,
y = nodes$y,
cutoff = 2500,
ldata = ldata
)
## Inspect the result for the first node.
ldata_augmented[, 1]
Run the code above in your browser using DataLab