showNb: Show Neighborhood

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/showNb.R

Description

Shows the neighborhood corresponding to the left-to-right then top-to-bottom raster scan order with additional information: variable names of the data frame returned by dataPrep, predictors used in the model returned by surfacemodel, or their percentage importance in the model (currently extracted from the rpart object). This function is useful for choosing a good neighborhood size and understanding relationship between pixels (e.g., periodicity).

Usage

1
showNb(model, what = c("neighborhood", "predictors", "importance"), plot.it = TRUE)

Arguments

model

either the object returned by surfacemodel or a positive vector of length 1 or 3 specifying the neighboorhood. If it is a vector, what <- "neighborhood".

what

what to show in the neighorhood. "neighborhood" shows variable names of the data frame returned by dataPrep, "predictors" shows predictors used in the model returned by surfacemodel, and "importance" shows their percentage importance in the model.

plot.it

if TRUE, plot the neighborhood.

Value

A matrix that contains the information for the plot (using the grid.table function).

Author(s)

Anh Bui

References

Bui, A.T. and Apley., D.W. (2018a) "A Monitoring and Diagnostic Approach for Stochastic Textured Surfaces", Technometrics, 60, 1-13.

See Also

dataPrep, surfacemodel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## show the neighorhood with variables names of the data frame constructed by dataPrep()
img <- matrix(1:25, 5, 5) # an image of size 5x5 pixels
img
dataPrep(img, 2)
showNb(c(2, 2, 2)) # showNb(2) has the same effect

## show the neighorhood with predictors and their importance used in the model returned
## by surfacemodel()
img <- sarGen(m = 100, n = 100, border = 50) # training image
model <- surfacemodel(img, nb = 3)
showNb(model, "predictors") # show predictors
showNb(model, "importance") # show predictor percentage importance

spc4sts documentation built on July 2, 2021, 5:06 p.m.