Visualization of a DSM distance matrix as a neighbourhood graph based on multidimensional scaling (MDS).
# S3 method for dist.matrix
plot(x, y, labels=rownames(x), show.labels=TRUE, label.pos=3,
selected=attr(x, "selected"), show.selected=TRUE,
col="black", cex=1, pch=20, pt.cex=1.2, selected.cex=1.2, selected.col="red",
show.edges=TRUE, edges.lwd=6, edges.col="#AABBFF", edges.threshold=quantile(x, 2/3),
method=c("isomds", "sammon"), aspect=1, expand=.05, …)
a symmetric distance matrix of class dist.matrix
. NB: similarity values and asymmetric distance measures are not supported.
unused, must not be specified
a character vector of labels for the DSM vectors (defaults to rownames of x
)
if TRUE
(default), labels are displayed if available
position of labels (default: above points). Possible values are 1
(below), 2
(left), 3
(above) and 4
(right).
logical vector of selected points that will be highlighted (defaults to optional selected
attribute of distance matrix)
if TRUE
(default), points marked by selected
are highlighted in the plot
colour of points and labels
numeric character expansion factor for points and labels
plot symbol for points
character expansion factor for points relative to labels
additional character expansion factor for selected points and labels
colour of selected points and labels (if show.selected=TRUE
)
if TRUE
(default), edges are drawn between points. The line width of each edge is proportional to the distance between the corresponding points.
maximal line width of edges (for \(d = 0\))
colour of edges, usually a light or translucent shade
maximal distance up to which edges are drawn. The default is to display two thirds of all edges.
whether to perform non-metric (isomds
) or metric (sammon
) multidimensional scaling
aspect ratio of plot window (e.g. aspect=16/10
for a window that is 8 inches wide and 5 inches high). Setting a correct aspect ratio ensures that the distances between points in the MDS map are correctly represented in the plot.
fraction by which plotting region is extended on each side. Adjust this parameter so that points and labels are completely visible.
all other arguments are passed to the initial plot function, which sets up the display but does not draw any graphical elements
Invisibly returns a two-column matrix with MDS coordinates of all displayed points and labels
as rownames (if available).
For multidimensional scaling (MDS), the functions isoMDS
and sammon
from the MASS package are used.
nearest.neighbours
, which produces distance matrices suitable for plotting if the option dist.matrix=TRUE
is specified
# NOT RUN {
plot(nearest.neighbours(DSM_Vectors, "walk_V", n=20, dist.matrix=TRUE))
# }
Run the code above in your browser using DataLab