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

Unconnected graph crashes skater() #29

Open
rsbivand opened this issue Mar 4, 2022 · 1 comment
Open

Unconnected graph crashes skater() #29

rsbivand opened this issue Mar 4, 2022 · 1 comment

Comments

@rsbivand
Copy link

rsbivand commented Mar 4, 2022

This will crash R:

library(sf)
columbus <- st_read(system.file("shapes/columbus.shp", package="spData"))
library(rgeoda)
columbus_43 <- columbus[columbus$NEIG != 43,]
plot(st_geometry(columbus_43), axes=TRUE)
qw <- queen_weights(columbus_43)
geoda_o <- skater(4, qw, columbus_43[,7:9])

#*** caught segfault ***
#address (nil), cause 'memory not mapped'

#Traceback:
# 1: p_skater(k, w$GetPointer(), df, n_vars, scale_method, distance_method,     bound_values, min_bound, random_seed, cpu_threads)
# 2: skater(4, qw, columbus_43[, 7:9])

I think because there is no check that the graph is connected for the minimum spanning tree step.

@timpwhite
Copy link

The code does not work correctly in the case of having unconnected regions. The skater function crashes R. Is there a plan to fix this?

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

No branches or pull requests

2 participants