From f9101f2351d0a4b1370ec91c55570139ce3904fd Mon Sep 17 00:00:00 2001 From: Marcel Costa Date: Sat, 5 Feb 2022 08:17:14 +0100 Subject: [PATCH] =?UTF-8?q?A=C3=B1adiendo=20la=20posibilidad=20de=20cambia?= =?UTF-8?q?r=20el=20m=C3=A9todo=20de=20correlaci=C3=B3n.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/ggcorrplot.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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