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)