当前位置:网站首页>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
)
边栏推荐
- TDSQL|就业难?腾讯云数据库微认证来帮你
- Bedtools tutorial
- spritejs
- C#基于当前时间,获取唯一识别号(ID)的方法
- Installation of ROS gazebo related packages
- 6方面带你认识LED软膜屏 LED软膜屏尺寸|价格|安装|应用
- sql left join 主表限制条件写在on后面和写在where后面的区别
- 基于Hardhat和Openzeppelin开发可升级合约(二)
- Attribute acquisition method and operation notes of C # multidimensional array
- QT获取某个日期是第几周
猜你喜欢
基于Hardhat和Openzeppelin开发可升级合约(一)
由粒子加速器产生的反中子形成的白洞
Always report errors when connecting to MySQL database
Win11 arm system configuration Net core environment variable
Pit of the start attribute of enumrate
VS2019代码中包含中文内容导致的编译错误和打印输出乱码问题
Verilog 和VHDL有符号数和无符号数相关运算
excel表格中选中单元格出现十字带阴影的选中效果
Is the Ren domain name valuable? Is it worth investing? What is the application scope of Ren domain name?
Digital transformation takes the lead to resume production and work, and online and offline full integration rebuilds business logic
随机推荐
Installation of ROS gazebo related packages
Homer forecast motif
bedtools使用教程
mmrotate旋转目标检测框架使用记录
tidb-dm报警DM_sync_process_exists_with_error排查
GGPUBR: HOW TO ADD ADJUSTED P-VALUES TO A MULTI-PANEL GGPLOT
The working day of the month is calculated from the 1st day of each month
基于 Openzeppelin 的可升级合约解决方案的注意事项
Is it safe to open a stock account online? I'm a novice, please guide me
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
CentOS8之mysql基本用法
从ros1到ros2配置的一些东西
Tidb DM alarm DM_ sync_ process_ exists_ with_ Error troubleshooting
Tiktok overseas tiktok: finalizing the final data security agreement with Biden government
【多线程】主线程等待子线程执行完毕在执行并获取执行结果的方式记录(有注解代码无坑)
Wechat applet uses Baidu API to achieve plant recognition
Tick Data and Resampling
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
Redis超出最大内存错误OOM command not allowed when used memory &gt; 'maxmemory'
Homer预测motif