local_moran: Calculate the Local Moran's I Statistic

View source: R/moran_test.R

local_moranR Documentation

Calculate the Local Moran's I Statistic

Description

Calculate the Local Moran's I Statistic

Usage

local_moran(x, nb, wt, alpha = 0.05, scale = TRUE, ...)

Arguments

x

A numeric vector.

...

See ?spdep::localmoran() for more options.

See Also

Other stats: geary_test(), moran_mc(), moran_test(), st_lag(), st_nb_dists()

Examples

library(tidyverse)

lisa <- sfweight::acs %>%
  mutate(nb = st_neighbors(geometry),
         wt = st_weights(nb),
         moran = local_moran(med_house_income, nb, wt))

pluck(lisa, "moran")

JosiahParry/sfweight documentation built on April 4, 2022, 1:52 a.m.