From f9dd553a8c527394ce0410e201e2992d351423c8 Mon Sep 17 00:00:00 2001 From: Marcel Costa Date: Sat, 5 Feb 2022 09:44:03 +0100 Subject: [PATCH] =?UTF-8?q?Desgrupar=20despu=C3=A9s=20de=20centralizar.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/ggheatmap.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/ggheatmap.R b/R/ggheatmap.R index a084013..35ebcb3 100644 --- a/R/ggheatmap.R +++ b/R/ggheatmap.R @@ -6,10 +6,10 @@ ggheatmap<-function(df, x=NULL, y=NULL, value=NULL, grouping="mean"){ df<-rename(df, "VarX"=all_of(x), "VarY"=all_of(y), "Value"=all_of(value)) if (grouping == "mean"){ - df<-df %>% group_by(VarX,VarY) %>% summarise(Value=mean(Value)) + df<-df %>% group_by(VarX,VarY) %>% summarise(Value=mean(Value)) %>% ungroup } if (grouping == "median"){ - df<-df %>% group_by(VarX,VarY) %>% summarise(Value=median(Value)) + df<-df %>% group_by(VarX,VarY) %>% summarise(Value=median(Value)) %>% ungroup } order<-clustsort(df %>% spread(VarY,Value) %>% as.data.frame)