当前位置:网站首页>HOW TO CREATE AN INTERACTIVE CORRELATION MATRIX HEATMAP IN R
HOW TO CREATE AN INTERACTIVE CORRELATION MATRIX HEATMAP IN R
2022-07-02 11:50:00 【Xiaoyu 2022】
df <- mtcars
library(heatmaply)
heatmaply_cor(
cor(df),
xlab = "Features",
ylab = "Features",
k_col = 2,
k_row = 2
)
df <- mtcars
library(heatmaply)
# Compute correlation coefficients
cor.coef <- cor(df)
# Compute correlation p-values
cor.test.p <- function(x){
FUN <- function(x, y) cor.test(x, y)[["p.value"]]
z <- outer(
colnames(x),
colnames(x),
Vectorize(function(i,j) FUN(x[,i], x[,j]))
)
dimnames(z) <- list(colnames(x), colnames(x))
z
}
p <- cor.test.p(df)
heatmaply_cor(
cor.coef,
node_type = "scatter",
point_size_mat = -log10(p),
point_size_name = "-log10(p-value)",
label_names = c("x", "y", "Correlation")
)
library(ggcorrplot)
# Compute a correlation matrix
corr <- round(cor(df), 1)
# Compute a matrix of correlation p-values
p.mat <- cor_pmat(df)
# Visualize the lower triangle of the correlation matrix
# Barring the no significant coefficient
corr.plot <- ggcorrplot(
corr, hc.order = TRUE, type = "lower", outline.col = "white",
p.mat = p.mat
)
corr.plot
library(ggcorrplot)
library(plotly)
# Compute a correlation matrix
corr <- round(cor(df), 1)
# Compute a matrix of correlation p-values
p.mat <- cor_pmat(df)
# Visualize the lower triangle of the correlation matrix
# Barring the no significant coefficient
corr.plot <- ggcorrplot(
corr, hc.order = TRUE, type = "lower", outline.col = "white",
p.mat = p.mat
)
ggplotly(corr.plot)
边栏推荐
- 预言机链上链下调研
- Tidb DM alarm DM_ sync_ process_ exists_ with_ Error troubleshooting
- [idea] use the plug-in to reverse generate code with one click
- 可升级合约的原理-DelegateCall
- RPA进阶(二)Uipath应用实践
- 基于Hardhat和Openzeppelin开发可升级合约(一)
- [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
- [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)
- HOW TO CREATE AN INTERACTIVE CORRELATION MATRIX HEATMAP IN R
- Homer forecast motif
猜你喜欢
[idea] use the plug-in to reverse generate code with one click
How to Visualize Missing Data in R using a Heatmap
A white hole formed by antineutrons produced by particle accelerators
Research on and off the Oracle chain
Cluster Analysis in R Simplified and Enhanced
可昇級合約的原理-DelegateCall
HOW TO ADD P-VALUES TO GGPLOT FACETS
Basic usage of MySQL in centos8
HOW TO CREATE A BEAUTIFUL INTERACTIVE HEATMAP IN R
亚马逊云科技 Community Builder 申请窗口开启
随机推荐
[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)
MySQL比较运算符IN问题求解
YYGH-BUG-04
文件操作(详解!)
CTF record
mysql 基本语句
Precautions for scalable contract solution based on openzeppelin
行业的分析
to_bytes与from_bytes简单示例
Cluster Analysis in R Simplified and Enhanced
2022年遭“挤爆”的三款透明LED显示屏
数据分析 - matplotlib示例代码
How to Add P-Values onto Horizontal GGPLOTS
How to Easily Create Barplots with Error Bars in R
HOW TO CREATE AN INTERACTIVE CORRELATION MATRIX HEATMAP IN R
RPA进阶(二)Uipath应用实践
deepTools对ChIP-seq数据可视化
[visual studio 2019] create and import cmake project
ESP32 Arduino 引入LVGL 碰到的一些问题
微信小程序利用百度api达成植物识别