Skip to content
Back to skills

Heatmaply

ASecurity

R heatmaply package for interactive heatmaps. Use for creating interactive clustered heatmaps with D3.js.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added June 4, 2026
datagonode

Works with

  • cli

Security analysis

A100/100

Scanned June 4, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill heatmaply --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Heatmaply?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Heatmaply
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-heatmaply/badge)](https://www.skillsdirectory.com/skills/leolin990405-heatmaply)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: heatmaply
description: R heatmaply package for interactive heatmaps. Use for creating interactive clustered heatmaps with D3.js.
---

# heatmaply

Interactive cluster heatmaps with plotly.

## Basic Heatmap

```r
library(heatmaply)

# Basic heatmap
heatmaply(mtcars)

# With scaling
heatmaply(mtcars, scale = "column")
heatmaply(mtcars, scale = "row")
heatmaply(mtcars, scale = "none")
```

## Clustering

```r
# Hierarchical clustering (default)
heatmaply(mtcars,
  distfun = "euclidean",
  hclustfun = "complete"
)

# Different distance methods
heatmaply(mtcars, distfun = "pearson")
heatmaply(mtcars, distfun = "spearman")
heatmaply(mtcars, distfun = "manhattan")

# Different clustering methods
heatmaply(mtcars, hclustfun = "ward.D2")
heatmaply(mtcars, hclustfun = "average")
heatmaply(mtcars, hclustfun = "single")

# No clustering
heatmaply(mtcars, dendrogram = "none")
heatmaply(mtcars, dendrogram = "row")
heatmaply(mtcars, dendrogram = "column")
```

## Color Scales

```r
# Viridis palettes
heatmaply(mtcars, colors = viridis::viridis(100))
heatmaply(mtcars, colors = viridis::magma(100))
heatmaply(mtcars, colors = viridis::plasma(100))

# RColorBrewer
heatmaply(mtcars, colors = RColorBrewer::brewer.pal(9, "YlOrRd"))

# Custom colors
heatmaply(mtcars, colors = colorRampPalette(c("blue", "white", "red"))(100))

# Diverging for correlation
heatmaply(cor(mtcars), colors = cool_warm)
```

## Annotations

```r
# Row annotations
row_side <- data.frame(
  Category = c(rep("A", 16), rep("B", 16)),
  row.names = rownames(mtcars)
)

heatmaply(mtcars, row_side_colors = row_side)

# Column annotations
col_side <- data.frame(
  Type = c(rep("Numeric", 5), rep("Factor", 6)),
  row.names = colnames(mtcars)
)

heatmaply(mtcars, col_side_colors = col_side)

# Both
heatmaply(mtcars,
  row_side_colors = row_side,
  col_side_colors = col_side
)
```

## Labels and Text

```r
# Show cell values
heatmaply(mtcars, cellnote = mtcars)

# Custom cell text
heatmaply(mtcars,
  cellnote = round(mtcars, 1),
  cellnote_textposition = "middle center"
)

# Label formatting
heatmaply(mtcars,
  fontsize_row = 8,
  fontsize_col = 10,
  label_names = c("Car", "Variable", "Value")
)
```

## Correlation Heatmap

```r
# Correlation matrix
cor_mat <- cor(mtcars)

heatmaply_cor(cor_mat,
  node_type = "scatter",
  point_size_mat = abs(cor_mat)
)

# With significance
library(Hmisc)
res <- rcorr(as.matrix(mtcars))

heatmaply_cor(res$r,
  node_type = "scatter",
  point_size_mat = -log10(res$P)
)
```

## Customization

```r
heatmaply(mtcars,
  main = "Motor Trend Car Data",
  xlab = "Variables",
  ylab = "Cars",
  margins = c(60, 100, 40, 20),
  grid_gap = 1,
  grid_color = "white",
  hide_colorbar = FALSE,
  branches_lwd = 0.5
)
```

## K-means Clustering

```r
# K-means instead of hierarchical
heatmaply(mtcars,
  k_row = 3,
  k_col = 2
)
```

## Seriation

```r
# Optimal leaf ordering
heatmaply(mtcars, seriate = "OLO")

# Other seriation methods
heatmaply(mtcars, seriate = "GW")
heatmaply(mtcars, seriate = "mean")
heatmaply(mtcars, seriate = "none")
```

## Export

```r
# Save as HTML
p <- heatmaply(mtcars)
htmlwidgets::saveWidget(p, "heatmap.html")

# Save as static image (requires webshot)
heatmaply(mtcars, file = "heatmap.png")
```

## With Shiny

```r
# In Shiny UI
heatmaplyOutput("heatmap")

# In Shiny server
output$heatmap <- renderHeatmaply({
  heatmaply(data())
})
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…