heatmap.2(margins)
时间: 2023-06-21 18:10:57 浏览: 93
`heatmap.2()` is a function in R that creates a heatmap with customizable features such as color schemes, scaling, and row/column dendrograms.
The `margins` argument in `heatmap.2()` allows you to add additional rows and columns on the sides of the heatmap to display summary statistics such as row and column means.
Here's an example code snippet using `heatmap.2()` with the `margins` argument:
```R
library(gplots)
# create example data
data <- matrix(rnorm(100), ncol = 10)
# create heatmap with margins
heatmap.2(data,
trace = "none",
col = colorRampPalette(c("navyblue", "white", "firebrick3"))(100),
margins = c(5, 5))
```
This will create a heatmap with 5 extra rows and columns on the top, bottom, left, and right sides that show the row and column means. The `trace` argument removes the color key legend and the `col` argument sets the color scheme for the heatmap.
阅读全文