-
Notifications
You must be signed in to change notification settings - Fork 2
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
not all patches linked by MPG() #32
Comments
@samdoctolero @ecologics poking at this more, I think we mis-diagnosed this bug: First, update to the latest version of the package to ensure the new test cases and test data are available to you. library(igraph)
library(raster)
devtools::load_all("~/GitHub/grainscape")
naError <- raster(system.file("extdata/naErrorExample.asc", package = "grainscape"))
naErrorMPG <- MPG(cost = naError, patch = (naError == 1))
## plotting the result, it appears the top right patches aren't connected
plot(naErrorMPG)
## however, the underlying igraph object looks correct
g <- naErrorMPG$mpg
#g <- simplify(g, remove.multiple = TRUE, remove.loops = TRUE)
count_components(g) ## equals 1, despite the plot above showing 2 subgraphs
plot(g) ## also shows all nodes connected To me it suggests that either the igraph object ( Thoughts? |
@samdoctolero the test passes, which suggests the spatial graph is being correctly built, but the raster is incorrect or being plotted incorrectly.
fixed in 5a5292a |
thanks @samdoctolero for tracking this down and fixing |
@cxfauvelle @ecologics please update your machines to the latest |
No kidding @samdoctolero. Big thanks.
Paul
|
Using the
NA
test case from #28, note that not all patches end up linked:The text was updated successfully, but these errors were encountered: