Closed alikhuseynov closed 1 year ago
If you get that error, it means that you have singletons, or spots that don't have neighbors. This behavior is the default in spdep. TBH I'm not entirely sure what to do with singletons. Sometimes Space Ranger output gives singletons because there are small bits of tissue with one spot. You can set zero.policy = TRUE
to silently drop the singleton (their spatially lagged values are set to 0 and don't affect global spatial statistics). See spdep documentation on the meaning of style
: https://r-spatial.github.io/spdep/reference/nb2listw.html Basically W means row normalize the spatial weights matrix, B means binary, "raw" means when distance based weights are used the weights are not changed in any way by normalization, C means normalize so all entries of the spatial weights matrix sum to n
(number of spots), U means C divided by n
.
zero.policy = TRUE
works, thanks! 👍
./outs/
looks like this:Any idea? It works when
data = "raw"
. What doesstyle
arg exactly mean, like “W”, “B”, “C”, “U”, “minmax” and “S”? Thank you.