Mercator-class {Mercator} | R Documentation |
Mercator
Distance Visualization Object
The Mercator
object applies one of 10 metrics of
binaryDistance
to an object of class
BinaryMatrix
and implements 5 visualizations for
clusters of large-scale, multi-dimensional data:
hierarchical clustering, heat map, multi-dimensional scaling,
t-Stochastic Neighbor Embedding (t-SNE), and iGraph.
Mercator(binaryMat, metric, method, K, ...) addVisualization(DV, method, ...) getClusters(DV)
binaryMat |
A |
metric |
A |
method |
A visualization method, limited to |
K |
An |
DV |
A distance visualization produced as the output of the
|
... |
Additional arguments passed on to the functions that
implement different methods for |
The Mercator
function constructs and returns a distance
visualization object of
Mercator
class, including a distance matrix calculated on a
given metric and given visualiations.
The addVisualizations
function can be used to add additional
visualizations to a given Mercator
object.
The getClusters
function returns a vector of cluster assignments.
metric
:Object of class "character"
; the name
of the binaryDistance
applied to create this object.
distance
:Object of class "dist"
; the distance
matrix calculated by this object.
view
:Object of class "list"
; contains the
calculations to generate each visualization added to the object.
colv
:Object of class "character"
; a vector
identifying the color assigned to each clustered feature.
symv
:Object of class "numeric"
; a vector
identifying the cluster number assigned to each clustered feature.
signature(object = "Mercator"@view[[n]], col = "Mercator"@colv, pch = "Mercator"@symv)
:
Produce a plot of the nth
visualization created within a
Mercator object. Producing a t-SNE plot requires the added
information "Mercator"@view[[n]]$Y
signature(object = "Mercator")
:
Produce a histogram of distances calculated in the dissimilarity
matrix generated in the Mercator
object.
signature(object = "Mercator")
: Returns the chosen distance metric, dimensions of the distance matrix, and available, calculated visualizations in this object.
signature(object = "Mercator")
: Returns the dimensions of the distance matrix of this object.
signature(object = "Mercator")
: Subsets the distance matrix of this object.
Kevin R. Coombes <krc@silicovore.com
#Form a BinaryMatrix data("iris") my.data <- as.matrix(iris[,c(1:4)]) my.rows <- as.data.frame(c(1:length(my.data[,1]))) my.binmat <- BinaryMatrix(my.data, , my.rows) my.binmat <- t(my.binmat) summary(my.binmat) # Form a Mercator object # Set K to the known number of species in the dataset my.vis <- Mercator(my.binmat, "euclid", "hclust", K=3) summary(my.vis) hist(my.vis) my.vis <- addVisualization(my.vis, "mds") plot(my.vis@view[[1]], col=my.vis@colv, pch=my.vis@symv) plot(my.vis@view[[2]], col=my.vis@colv, pch=my.vis@symv) #Recover cluster identities #What species comprise cluster 1? my.clust <- getClusters(my.vis) my.species <- iris$Species[my.clust == 1] my.species