Browse Source

Añadiendo la posibilidad de cambiar el método de correlación.

main
Marcel Costa 2 years ago
parent
commit
f9101f2351
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      R/ggcorrplot.R

+ 3
- 3
R/ggcorrplot.R

@ -1,7 +1,7 @@
ggcorrplot<-function(df, var, color="#FFFFFF00", stat="signif", tri="all"){
ggcorrplot<-function(df, var, color="#FFFFFF00", stat="signif", tri="all", method="pearson"){
m.df<-df %>% spread(Cyt, Value) %>% select(-pats)
mcor<-cor(m.df, m.df, use="pairwise.complete.obs") # Por defecto usa el método de Pearson.
mpval<-Hmisc::rcorr(as.matrix(m.df))$P
mcor<-cor(m.df, m.df, use="pairwise.complete.obs", method = method) # Por defecto usa el método de Pearson.
mpval<-Hmisc::rcorr(as.matrix(m.df), type=method)$P
order<- mcor %>% as.data.frame() %>% add_column(Var1=rownames(mcor),.before=1) %>% clustsort

Loading…
Cancel
Save