当前位置:网站首页>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
)
边栏推荐
- GGPLOT: HOW TO DISPLAY THE LAST VALUE OF EACH LINE AS LABEL
- PHP query distance according to longitude and latitude
- ROS lacks catkin_ pkg
- mysql链表数据存储查询排序问题
- [cloud native] 2.5 kubernetes core practice (Part 2)
- Principe du contrat évolutif - delegatecall
- Tdsql | difficult employment? Tencent cloud database micro authentication to help you
- Easyexcel and Lombok annotations and commonly used swagger annotations
- Data analysis - Matplotlib sample code
- How to Create a Nice Box and Whisker Plot in R
猜你喜欢

Thesis translation: 2022_ PACDNN: A phase-aware composite deep neural network for speech enhancement

GGHIGHLIGHT: EASY WAY TO HIGHLIGHT A GGPLOT IN R

6. Introduce you to LED soft film screen. LED soft film screen size | price | installation | application

Always report errors when connecting to MySQL database

Summary of data export methods in powerbi

Amazon cloud technology community builder application window opens

动态内存(进阶四)

数据分析 - matplotlib示例代码

GGPlot Examples Best Reference

R HISTOGRAM EXAMPLE QUICK REFERENCE
随机推荐
6. Introduce you to LED soft film screen. LED soft film screen size | price | installation | application
Skills of PLC recorder in quickly monitoring multiple PLC bits
PX4 Position_ Control RC_ Remoter import
QT获取某个日期是第几周
Thesis translation: 2022_ PACDNN: A phase-aware composite deep neural network for speech enhancement
通讯录的实现(文件版本)
How to Visualize Missing Data in R using a Heatmap
Installation of ROS gazebo related packages
What week is a date obtained by QT
【2022 ACTF-wp】
Visualization of chip SEQ data by deeptools
STM32 single chip microcomputer programming learning
GGHIGHLIGHT: EASY WAY TO HIGHLIGHT A GGPLOT IN R
R HISTOGRAM EXAMPLE QUICK REFERENCE
多文件程序X32dbg动态调试
Redis exceeds the maximum memory error oom command not allowed when used memory & gt; ' maxmemory'
GGPlot Examples Best Reference
Data analysis - Matplotlib sample code
How to Create a Nice Box and Whisker Plot in R
easyExcel和lombok注解以及swagger常用注解
