View source: R/general.purpuse.utilities.R
getColoursByDistance | R Documentation |
use MDS (via cmdscale) to map objects into colour space
getColoursByDistance(d, use3D = FALSE, orderBySim = FALSE)
d |
distance matrix to be used with MDS |
use3D |
logical, specifies whether whole 0,1^3 space should be used. About equally-bright 2D space is used otherwise (default) |
orderBySim |
logical, whether objects should be ordered by similarity. Preserves original order otherwise (default) |
vector of colors
d=1-cor(t(mtcars))
c=getColoursByDistance(d,F)
plot(cmdscale(d),col=c,pch=19)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.