st_nb_apply | R Documentation |

Sometimes one may want to create custom lag variables or create some other neighborhood level metric that may not be defined yet. This `st_nb_apply()`

enables you to apply a function to each observation's (xi) neighbors (xij).

st_nb_apply(x, nb, wt, .f, suffix = "dbl", ...)

`x` |
A vector that will be used for neighbor xij values. |

`nb` |
A neighbor list object as created by |

`wt` |
A weights list as created by |

`.f` |
A function definition. There are three default objects that can be used inside of the function definition: -
`.xij` : neighbor values of`x` for the ith observation. This is simply the subset of x based on the corresponding`nb` list values for each element. -
`.nb` : neighbor positions. -
`.wt` : neighbor weights value.
If any of these three function arguments are omitted from |

`suffix` |
The |

`...` |
See |

#TODO make acs_nb object and make examples

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.