plotStewart | R Documentation |
This function plots the raster produced by the
rasterStewart
function.
plotStewart(
x,
add = FALSE,
breaks = NULL,
typec = "equal",
nclass = 5,
legend.rnd = 0,
col = colorRampPalette(c("#FEA3A3", "#980000"))
)
x |
raster; output of the |
add |
logical; if TRUE the raster is added to the current plot, if FALSE the raster is displayed in a new plot. |
breaks |
numeric; vector of break values to map. If used,
this parameter overrides |
typec |
character; either "equal" or "quantile", how to discretize the values. |
nclass |
numeric (integer), number of classes. |
legend.rnd |
numeric (integer); number of digits used to round the values displayed in the legend. |
col |
function; color ramp function, such as |
Display the raster nicely and return the list of break values (invisible).
stewart, rasterStewart, quickStewart, CreateGrid, CreateDistMatrix.
data(hospital)
# Compute Stewart potentials from known points (hospital) on a
# grid defined by its resolution
mystewart <- stewart(knownpts = hospital, varname = "capacity",
typefct = "exponential", span = 1000, beta = 3,
resolution = 100, mask = paris)
# Create a raster of potentials values
mystewartraster <- rasterStewart(x = mystewart, mask = paris)
# Plot stewart potentials nicely
plotStewart(x = mystewartraster, add = FALSE, nclass = 5)
# Can be used to obtain break values
break.values <- plotStewart(x = mystewartraster, add = FALSE, nclass = 5)
break.values
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.