Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft bivariate moran hotspots #155 #156

Merged
merged 6 commits into from
Jun 10, 2024
Merged

draft bivariate moran hotspots #155 #156

merged 6 commits into from
Jun 10, 2024

Conversation

rsbivand
Copy link
Member

@rsbivand rsbivand commented Jun 5, 2024

@JosiahParry Could you check please?

The function man page now has:

library(spdep)
columbus <- st_read(system.file("shapes/columbus.shp", package="spData"))
nb <- poly2nb(columbus)
listw <- nb2listw(nb)
set.seed(1)
(res <- localmoran_bv(columbus$CRIME, columbus$INC, listw, nsim = 499))
columbus$hs <- hotspot(res, Prname="Pr(folded) Sim", cutoff=0.05,
 quadrant.type="pysal", p.adjust="none")
if (require("tmap", quietly=TRUE)) {
  tm_shape(columbus) + tm_fill("hs")
}

With the latest spData release, columbus.gpkg is available, avoiding the warning from tmap. spData is changing to GPKG from SHP.

@rsbivand
Copy link
Member Author

@JosiahParry any chance of a response? I'd like to submit to CRAN this week.

@JosiahParry
Copy link
Contributor

Thanks for the bump @rsbivand! These changes look great! I think having the plot function in the help page will also be very helpful for users. I feel comfortable merging this in.

@rsbivand rsbivand merged commit 0e10019 into main Jun 10, 2024
4 checks passed
@rsbivand rsbivand deleted the bv_hotspot branch June 10, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants