Last data update: 2014.03.03

R: Display similarity matrix
distmapR Documentation

Display similarity matrix

Description

Calculates and visualizes a similarity matrix for subjects or variables in an image plot

Usage

distmap(data, what = c("subjects", "variables"), varweights, reorderdend, col, ...)

Arguments

data

data.frame with original data or similarity matrix

what

Shall similarity matrix of subjects or variables be visualized?; ignored if data is a similarity matrix

varweights

optional vector of variable weights, used for calculating Gower's distances between subjects; ignored if what = "variables"

reorderdend

optional numeric values for reordering the dendrogram (maintaining the constraints on the dendrogram), see wts option of reorder.dendrogram

col

Color palette; defaults to blue-scale palette, where darker blue indicates higher similarity

...

graphical parameters passed to heatmap.2

Details

If data is a data.frame, the similarity matrix is calculated for subjects (if what = "subjects") or variables (if what = "variables"). Similarities for subjects are calculated by similarity.subjects. Similarities for variables are derived by similarity.variables with the default associationFun=association function for measuring similarities between variables. Alternatively, data can also be a previously calculated similarity matrix.

Value

Image plots and dendrograms

Author(s)

Manuela Hummel

See Also

similarity.variables, dist.variables, similarity.subjects, dist.subjects, mix.heatmap

Examples

data(mixdata)

distmap(mixdata, what="subjects")
distmap(mixdata, what="variables")

## example with variable weights
w <- rep(1:2, each=5)
distmap(mixdata, what="subjects", varweights=w)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(CluMix)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/CluMix/distmap.Rd_%03d_medium.png", width=480, height=480)
> ### Name: distmap
> ### Title: Display similarity matrix
> ### Aliases: distmap
> ### Keywords: hplot
> 
> ### ** Examples
> 
> data(mixdata)
> 
> distmap(mixdata, what="subjects")
> distmap(mixdata, what="variables")
> 
> ## example with variable weights
> w <- rep(1:2, each=5)
> distmap(mixdata, what="subjects", varweights=w)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>