当前位置:网站首页>HOW TO CREATE A BEAUTIFUL INTERACTIVE HEATMAP IN R
HOW TO CREATE A BEAUTIFUL INTERACTIVE HEATMAP IN R
2022-07-02 09:38:00 【小宇2022】
install.packages("heatmaply")
library("heatmaply")
df <- normalize(mtcars)
heatmaply(df)

install.packages("heatmaply")
library("heatmaply")
df <- normalize(mtcars)
ggheatmap(df)
gplots::heatmap.2(
as.matrix(df),
trace = "none",
col = viridis(100),
key = FALSE
)

install.packages("heatmaply")
library("heatmaply")
df <- normalize(mtcars)
heatmaply(
as.matrix(df),
seriate = "mean",
row_dend_left = TRUE,
plot_method = "plotly"
)

install.packages("heatmaply")
library("heatmaply")
df <- normalize(mtcars)
heatmaply(
df,
k_col = 2,
k_row = 2
)

install.packages("heatmaply")
library("heatmaply")
df <- normalize(mtcars)
heatmaply(
df,
colors = viridis(n = 256, option = "magma"),
k_col = 2,
k_row = 2
)

install.packages("heatmaply")
library("heatmaply")
df <- normalize(mtcars)
library(RColorBrewer)
heatmaply(
df,
colors = colorRampPalette(brewer.pal(3, "RdBu"))(256),
k_col = 2,
k_row = 2
)

install.packages("heatmaply")
library("heatmaply")
df <- normalize(mtcars)
gradient_col <- ggplot2::scale_fill_gradient2(
low = "blue", high = "red",
midpoint = 0.5, limits = c(0, 1)
)
heatmaply(
df,
scale_fill_gradient_fun = gradient_col
)

library(dendextend)
# Create dendrogram for rows
mycols <- c("#2E9FDF", "#00AFBB", "#E7B800", "#FC4E07")
row_dend <- df %>%
dist() %>%
hclust() %>%
as.dendrogram() %>%
set("branches_lwd", 1) %>%
set("branches_k_color", mycols[1:3], k = 3)
# Create dendrogram for columns
col_dend <- df %>%
t() %>%
dist() %>%
hclust() %>%
as.dendrogram() %>%
set("branches_lwd", 1) %>%
set("branches_k_color", mycols[1:2], k = 2)
heatmaply(
df,
Rowv = row_dend,
Colv = col_dend
)

library(dendextend)
# Create dendrogram for rows
mycols <- c("#2E9FDF", "#00AFBB", "#E7B800", "#FC4E07")
row_dend <- df %>%
dist() %>%
hclust() %>%
as.dendrogram() %>%
set("branches_lwd", 1) %>%
set("branches_k_color", mycols[1:3], k = 3)
# Create dendrogram for columns
col_dend <- df %>%
t() %>%
dist() %>%
hclust() %>%
as.dendrogram() %>%
set("branches_lwd", 1) %>%
set("branches_k_color", mycols[1:2], k = 2)
heatmaply(
df[, -c(8, 9)],
col_side_colors = c(rep(0, 5), rep(1, 4)),
row_side_colors = df[, 8:9]
)

library(dendextend)
# Create dendrogram for rows
mycols <- c("#2E9FDF", "#00AFBB", "#E7B800", "#FC4E07")
row_dend <- df %>%
dist() %>%
hclust() %>%
as.dendrogram() %>%
set("branches_lwd", 1) %>%
set("branches_k_color", mycols[1:3], k = 3)
# Create dendrogram for columns
col_dend <- df %>%
t() %>%
dist() %>%
hclust() %>%
as.dendrogram() %>%
set("branches_lwd", 1) %>%
set("branches_k_color", mycols[1:2], k = 2)
heatmaply(df, cellnote = mtcars)

library(dendextend)
# Create dendrogram for rows
mycols <- c("#2E9FDF", "#00AFBB", "#E7B800", "#FC4E07")
mat <- df
mat[] <- paste("This cell is", rownames(mat))
mat[] <- lapply(colnames(mat), function(colname) {
paste0(mat[, colname], ", ", colname)
})
heatmaply(
df,
custom_hovertext = mat
)
边栏推荐
- 原生方法合并word
- ren域名有价值吗?值不值得投资?ren域名的应用范围有哪些?
- 亚马逊云科技 Community Builder 申请窗口开启
- MySQL linked list data storage query sorting problem
- Liftover for genome coordinate conversion
- VS2019代码中包含中文内容导致的编译错误和打印输出乱码问题
- Webauthn - official development document
- enumrate的start属性的坑
- ESP32音频框架 ESP-ADF 添加按键外设流程代码跟踪
- Is the stock account given by qiniu business school safe? Can I open an account?
猜你喜欢

mysql链表数据存储查询排序问题

Tdsql | difficult employment? Tencent cloud database micro authentication to help you

Jinshanyun - 2023 Summer Internship

Verilog 和VHDL有符号数和无符号数相关运算

Tick Data and Resampling
![[cloud native] 2.5 kubernetes core practice (Part 2)](/img/87/826894d758392a0c7a60dd5fa09eef.png)
[cloud native] 2.5 kubernetes core practice (Part 2)

II Stm32f407 chip GPIO programming, register operation, library function operation and bit segment operation

PHP tea sales and shopping online store

JS——每次调用从数组里面随机取一个数,且不能与上一次为同一个

揭露数据不一致的利器 —— 实时核对系统
随机推荐
What are the methods of adding elements to arrays in JS
Tiktok overseas tiktok: finalizing the final data security agreement with Biden government
TDSQL|就业难?腾讯云数据库微认证来帮你
PKG package manager usage instance in FreeBSD
可升级合约的原理-DelegateCall
Wechat applet uses Baidu API to achieve plant recognition
tidb-dm报警DM_sync_process_exists_with_error排查
GGHIGHLIGHT: EASY WAY TO HIGHLIGHT A GGPLOT IN R
原生方法合并word
Webauthn - official development document
对毕业季即将踏入职场的年轻人的一点建议
ros缺少catkin_pkg
2022年遭“挤爆”的三款透明LED显示屏
Principle of scalable contract delegatecall
QT获取某个日期是第几周
vant tabs组件选中第一个下划线位置异常
deepTools对ChIP-seq数据可视化
Principe du contrat évolutif - delegatecall
Is it safe to open a stock account through the QR code of the securities manager? Or is it safe to open an account in a securities company?
What is the relationship between digital transformation of manufacturing industry and lean production
