showCells {ssExtra}R Documentation

Highlight desired cells on a Sampling Surface

Description

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.

Usage

showCells(ss,
          cells,
          cell.col = "salmon2",
          alphaTrans = 0.2,
          showSS = TRUE,
          showPoints = TRUE,
          point.col = "gray25",
          ...)

Arguments

ss

An object of class sampSurf.

cells

A vector of cell numbers in the sampSurf object to be displayed differently as sample points.

cell.col

The color for the cells to be displayed.

alphaTrans

Transparencey: see transparentColorBase.

showSS

TRUE: first plot the sampSurf object; FALSE: assume we are adding to an existing figure. Note that the existing figure need not be a sampling surface, but must be of the same extents as the sampling surface passed in the ss argument.

showPoints

TRUE: show the sample points (cell centers); FALSE: display only the entire cell shading.

point.col

The color for the sample points (cell centers).

...

Passed on to image and points.

Details

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.

Value

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.

Author(s)

Jeffrey H. Gove

See Also

plot

Examples

## 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)

[Package ssExtra version 0.1-2 Index]