Description Usage Arguments Value Author(s) See Also Examples
View source: R/scaleDistPlot.R
Produces annotated representations of two-dimensional
multidimensional scaling plots using cmdscale
.
1 2 3 4 5 |
dmat |
Square matrix of pairwise distances. |
groups |
Object coercible to a factor identifying group
membership of objects corresponding to either edge of |
fill |
vector (logical or indices) of points to fill |
X |
vector of points to mark with an X |
O |
vector of points to mark with a circle |
indices |
label points with indices (all points if 'yes', or a subset indicated by a vector) |
include |
boolean or numeric vector of elements to include in call to cmdscale |
display |
boolean or numeric vector of elements to include in call to display |
labels |
list or data frame with parameters $i indicating indices and $text containing labels. |
shuffleGlyphs |
modify permutation of shapes and colors given an integer to serve as a random seed. |
key |
'right' (single column), 'top' (variable number of columns), or NULL for no key |
keyCols |
number of columns in key |
glyphs |
a data.frame with columns named |
xflip |
if TRUE, flip orientation of x-axis |
yflip |
if TRUE, flip orientation of y-axis |
... |
additional arguments are passed to |
Returns a lattice grid object.
Noah Hoffman
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | data(iris)
dmat <- as.matrix(dist(iris[,1:4], method="euclidean"))
groups <- iris$Species
## visualize pairwise euclidean dstances among items in the Iris data set
fig <- scaleDistPlot(dmat, groups)
plot(fig)
## leave-one-out analysis of the classifier
loo <- lapply(seq_along(groups), function(i){
do.call(classify, pull(dmat, groups, i))
})
matches <- lapply(loo, function(x) rev(x)[[1]]$matches)
result <- sapply(matches, paste, collapse='-')
confusion <- sapply(matches, length) > 1
no_match <- sapply(matches, length) < 1
plot(scaleDistPlot(dmat, groups, fill=confusion, O=confusion, X=no_match))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.