Code Monkey home page Code Monkey logo

Comments (5)

achubaty avatar achubaty commented on June 28, 2024

@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 (naErrorMPG$mpg) differs from the raster that is produced (and then plotted) OR that the plotting is screwing up (though this seems unlikely because it's simply plotting the raster using base R, i.e., nothing we coded).

Thoughts?

from grainscape.

achubaty avatar achubaty commented on June 28, 2024

fixed in 5a5292a

from grainscape.

achubaty avatar achubaty commented on June 28, 2024

thanks @samdoctolero for tracking this down and fixing

from grainscape.

achubaty avatar achubaty commented on June 28, 2024

@cxfauvelle @ecologics please update your machines to the latest grainscape, which fixes the patch-linking bug

from grainscape.

ecologics avatar ecologics commented on June 28, 2024

from grainscape.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.