Description Usage Arguments Value Author(s) References See Also Examples
Given a series of GOC models built at different scales in a gsGOC
object, visualize one the tessellations (i.e. scales) in these models.
Visualization is by default in raster format. Vector based visualization is also possible.
1 | gsGOCVisualize(gsGOC, whichThresh, sp = FALSE, doPlot=FALSE)
|
gsGOC |
A |
whichThresh |
Integer giving the index of the threshold to visualize. |
sp |
Logical. If |
doPlot |
Logical. If |
A list object:
$summary
giving the properties of the visualized scale of the GOC model
$voronoi
giving the tessellation (RasterLayer
)
$centroids
the centroids of the polygons in the tessellation (SpatialPoints
)
$voronoiSP
vector representation of polygons in the tessellation (SpatialPolygonsDataFrame
; if sp=TRUE
)
Paul Galpern (pgalpern@gmail.com)
Fall, A., M.-J. Fortin, M. Manseau, D. O'Brien. (2007) Spatial graphs: Principles and applications for habitat connectivity. Ecosystems. 10:448:461
Galpern, P., M. Manseau, P.J. Wilson. (2012) Grains of connectivity: analysis at multiple spatial scales in landscape genetics. Molecular Ecology 21:3996-4009.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## Not run:
## Load raster landscape
tiny <- raster(system.file("extdata/tiny.asc", package="grainscape"))
## Create a resistance surface from a raster using an is-becomes reclassification
tinyCost <- reclassify(tiny, rcl=cbind(c(1, 2, 3, 4), c(1, 5, 10, 12)))
## Produce a patch-based MPG where patches are resistance features=1
tinyPatchMPG <- gsMPG(cost=tinyCost, patch=tinyCost==1)
## Extract a representative subset of 5 grains of connectivity
tinyPatchGOC <- gsGOC(tinyPatchMPG, nThresh=5)
## Very quick visualization at the finest scale/grain/threshold
## Producing plot on the default graphics device
gsGOCVisualize(tinyPatchGOC, whichThresh=1, doPlot=TRUE)
## Visualize the model at the finest scale/grain/threshold
## Manual control of plotting
plot(gsGOCVisualize(tinyPatchGOC, whichThresh=1)$voronoi,
col=sample(rainbow(100)), legend=FALSE, main="Threshold 1")
## Extract a representative subset of 5 grains of connectivity for vector visualization
tinyPatchGOC <- gsGOC(tinyPatchMPG, nThresh=5, sp=TRUE)
## Visualize the model at a selected scale/grain/threshold using vector polygons
plot(tinyPatchMPG$patchId, col="grey", legend=FALSE)
plot(gsGOCVisualize(tinyPatchGOC, whichThresh=3, sp=TRUE)$voronoiSP,
add=TRUE, lwd=2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.