showCells {ssExtra} | R Documentation |
This function allows one to display certain cells with a different
background color and, optionally mark their cell centers. This is
usedful when it might be desired to highlight certain cells on a
sampling surface. Potential uses include showing where a subsample of
cells are located on the surface. Also, by using
listCellStem
, one can offset individual overlap regions
of inclusion zones.
showCells(ss, cells, cell.col = "salmon2", alphaTrans = 0.2, showSS = TRUE, showPoints = TRUE, point.col = "gray25", ...)
ss |
An object of class |
cells |
A vector of cell numbers in the
|
cell.col |
The color for the cells to be displayed. |
alphaTrans |
Transparencey: see
|
showSS |
|
showPoints |
|
point.col |
The color for the sample points (cell centers). |
... |
This routine can be used to either plot a “sampSurf” object and
add a vector of sample points to it for display, or simply to add the
sample points to an existing plot. Either way, the assumption is that
we have sampled the full sampling surface in the sense of drawing a
subsample of points from the full set of cells in the
Tract
slot of the object. For example, this would
allow the display of sample points drawn randomly from a surface in
one Monte Carlo replication from any of the methods associated with
the monte
, including the method(s) contained
within the current package (ssExtra).
Note that with the default choices for cell.col
and
alphaTrans
it can be very difficult to see the shading for the
cells on larger tracts (rasters). In this case, decrease the
transparency and choose a brighter color for the cells in order to
display them more prominently. Similarly for point.col
, though
alphaTrans
is not directly used for the points; however, one
can pass point.col
as a color that has been returned from
transparentColorBase
to achieve the same
effect.
The function returns an object of class
RasterLayer
(invisibly) where only those
cells that were passed in cells
are not NA
. The
values for the cells are the cell numbers passed.
Jeffrey H. Gove
## Not run: tr = Tract(c(x=50,y=50), cellSize=0.5) btr = bufferedTract(10, tr) ssSA = sampSurf(3, btr, iZone = 'sausageIZ', plotRadius=3, buttDiam=c(30,50), startSeed=1001) plot(ssSA, axes=TRUE) summary(ssSA) # #add the sample points... # showCells(ssSA, cells = sample(1:10000, 100), showSS=FALSE) ## End(Not run)