Comments (5)
@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.
fixed in 5a5292a
from grainscape.
thanks @samdoctolero for tracking this down and fixing
from grainscape.
@cxfauvelle @ecologics please update your machines to the latest grainscape
, which fixes the patch-linking bug
from grainscape.
from grainscape.
Related Issues (20)
- updated 'GOC' example fails with 'graphdf()' use HOT 1
- corridor() fails when coords are on NA cells HOT 1
- Unexpected plot() behaviour with lattice MPG() HOT 4
- Retitle package HOT 1
- vignette is too big HOT 5
- check the use of Makevars HOT 1
- improved use of S4
- eucPerimWeight doesn't work in GOC() and threshold()
- Poor error message with GOC(..., whichThresh=) under corner case
- add ORCID ids to authors in DESCRIPTION HOT 1
- update package citation with paper (once accepted) HOT 1
- properly display C++ code in MPG_algorithm vignette HOT 1
- replace 'geom_raster' with 'geom_tile'
- improve plotting of large rasters/polygons
- grainscape vulnerable to forthcoming changes in sp and rgdal HOT 5
- I always end up with 2 as nComponents in Scalar Analysis HOT 3
- shortest_paths() HOT 1
- Please remove dependencies on **rgdal**, **rgeos**, and/or **maptools** HOT 6
- migrate from `sp`/`raster` to `sf`/`terra`
- reduce package size
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grainscape.