当前位置:网站首页>HOW TO CREATE A BEAUTIFUL INTERACTIVE HEATMAP IN R
HOW TO CREATE A BEAUTIFUL INTERACTIVE HEATMAP IN R
2022-07-02 11:50:00 【Xiaoyu 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
)
边栏推荐
- FLESH-DECT(MedIA 2021)——一个material decomposition的观点
- Mmrotate rotation target detection framework usage record
- YYGH-BUG-05
- 制造业数字化转型和精益生产什么关系
- Some problems encountered in introducing lvgl into esp32 Arduino
- Skills of PLC recorder in quickly monitoring multiple PLC bits
- 2022年遭“挤爆”的三款透明LED显示屏
- SSRF
- Cluster Analysis in R Simplified and Enhanced
- Precautions for scalable contract solution based on openzeppelin
猜你喜欢
在连接mysql数据库的时候一直报错
TDSQL|就业难?腾讯云数据库微认证来帮你
The computer screen is black for no reason, and the brightness cannot be adjusted.
pgsql 字符串转数组关联其他表,匹配 拼接后原顺序展示
[visual studio 2019] create MFC desktop program (install MFC development components | create MFC application | edit MFC application window | add click event for button | Modify button text | open appl
II Stm32f407 chip GPIO programming, register operation, library function operation and bit segment operation
vant tabs组件选中第一个下划线位置异常
What is the relationship between digital transformation of manufacturing industry and lean production
Cluster Analysis in R Simplified and Enhanced
A sharp tool for exposing data inconsistencies -- a real-time verification system
随机推荐
[multithreading] the main thread waits for the sub thread to finish executing, and records the way to execute and obtain the execution result (with annotated code and no pit)
Pyqt5+opencv project practice: microcirculator pictures, video recording and manual comparison software (with source code)
Basic usage of MySQL in centos8
【多线程】主线程等待子线程执行完毕在执行并获取执行结果的方式记录(有注解代码无坑)
预言机链上链下调研
Visualization of chip SEQ data by deeptools
flutter 问题总结
HOW TO EASILY CREATE BARPLOTS WITH ERROR BARS IN R
可升级合约的原理-DelegateCall
PX4 Position_Control RC_Remoter引入
PYQT5+openCV项目实战:微循环仪图片、视频记录和人工对比软件(附源码)
MySql存储过程游标遍历结果集
Native method merge word
CMake交叉编译
The selected cells in Excel form have the selection effect of cross shading
微信小程序利用百度api达成植物识别
TDSQL|就业难?腾讯云数据库微认证来帮你
[visual studio 2019] create MFC desktop program (install MFC development components | create MFC application | edit MFC application window | add click event for button | Modify button text | open appl
Bedtools tutorial
Take you ten days to easily finish the finale of go micro services (distributed transactions)