pcor_dat | R Documentation |
Perform partial correlation analysis of two data matrix
pcor_dat(x, y, method = c("pearson", "kendall", "spearman"))
x , y |
two data matrix for correlation analyses. |
method |
correlation method. |
a correlation matrix.
ppcor::pcor()
library(dplyr)
library(tidyr)
library(purrr)
## 'data' has been processed.
data <- mtExtra:::data
meta <- mtExtra:::meta
## filtering
meta <- mv_filter(meta, thres = 0.3)$dat
## missing value filling
meta <- meta %>%
mutate(across(where(is.numeric), function(x) {
m <- mean(x, na.rm = TRUE)
x[is.na(x)] <- m
x
}))
## normalisation
meta <- meta %>%
mutate(across(where(is.numeric), ~ {
.x <- (.x - mean(.x, na.rm = TRUE)) / sd(.x, na.rm = TRUE)
}))
co <- pcor_dat(meta, data)
heat_dend(co)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.