hmReady: creates a heatmap-ready data.frame

Description Usage Arguments Value Examples

View source: R/hmReady.R

Description

Imports: reshape2

Usage

1
hmReady(df, rowclus = NULL, colclus = NULL)

Arguments

df

data.frame

rowclus

hclust object, use only if rows should be clustered

colclus

hclust object, use only if columns should be clustered

Value

a data.frame with x, y and value column, ready to be plotted by geom_tile.

Examples

1
2
3
4
5
6
7
8
9
library(ggdendroplot)

df <- as.data.frame(matrix(rnorm(99), ncol = 9))
rownames(df) <- paste0("trait", seq(nrow(df)))

clust <- hclust(dist(df))
hm <- hmReady(df, rowclus=clust)

ggplot(hm, aes(x, y, fill=value)) + geom_tile()

NicolasH2/ggdendroplot documentation built on Dec. 17, 2021, 5:24 a.m.