scatterLID | R Documentation |
Plot the local group and non-group components of a local indicator of dispersion, colored by their inference-based class.
scatterLID(
lid = NULL,
inference = NULL,
log.scale = FALSE,
key = TRUE,
only.key = FALSE,
arrows = FALSE,
x.lim = NULL,
y.lim = NULL
)
colorLID(x = NULL, table = FALSE, arrows = FALSE)
lid |
The list output of the |
inference |
The list output of the |
log.scale |
Logical. Should the axes be log-transformed? Default is |
key |
Logical. Should a color key be printed? Default is |
only.key |
Logical. If |
arrows |
Logical. Should the points be displayed as arrows pointing to the appropriate
quadrant according to the key? Default is |
x.lim |
One of |
y.lim |
One of |
x |
A character string or vector containing a LID significance class.
Ignored if |
table |
Logical. Should the function convert character strings of classes
to hex codes of colors ( |
colorLID()
acts as a function converting class names to the hex codes corresponding
to the colors used by scatterLID when table = FALSE
(the default), and
returns the color table itself when table = FALSE
.
A ggplot object with two elements—the LID Scatter plot and its scale.
# Generate dummy observations
x <- runif(10, 1, 100)
# Get distance matrix
dists <- dist(x)
# Get fuzzy weights considering 5 nearest neighbors based on
# inverse square distance
weights <- makeWeights(dists, bw = 5,
mode = 'adaptive', weighting = 'distance',
FUN = function(x) 1/x^2, minval = 0.1,
row.stand = 'fuzzy')
# Obtain the 'local gini' value
lid <- LID(x, w = weights, index = 'gini', type = 'local')
# Infer whether values are significant relative to the spatial distribution
# of the neighbots
inference <- inferLID(lid, w = weights, ntrials = 100, pb = FALSE)
# Plot the inferences
scatterLID(lid, inference)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.