diff --git a/R/ggcorrplot.R b/R/ggcorrplot.R index 7300de9..c928eb5 100644 --- a/R/ggcorrplot.R +++ b/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